Part Number Hot Search : 
DF685 D0703 ALE15B12 K30102A AE10589 A3952SEB DB3501 AAT4684
Product Description
Full Text Search
 

To Download 71M6531D10 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  71m6531d/f, 71m6532d/f energy meter ic simpli fying system integration tm data sheet june 2010 v1.3 ? 2005 - 2010 teridian semiconductor corporation 1 general description the t eridian 71m6531d/f and 71m6532d/f are highly in te grated soc s with an mpu core, rtc, flash and lcd driver. t eri dian ?s patented single con verter technology ? with a 22 - bit delta - sigma adc, four ana log inputs, digital temperatur e com pensation, pre cision voltage re f erence, battery voltage monitor and 32 - bit com puta tion engine (ce) supports a wide range of re sidential metering applications with very few low - cost external com ponents. a 32 - khz crystal time base for the entire system and internal bat tery backup support for ram and rtc further re duce system cost. the ic supports 2 - wire, and 3 - wire single - phase and dual - phase re sidential metering along with tamper - detection me chanisms. the 71m6531d/f offers single - ended in put s for two current channel s and two single - ended voltage inputs . the 71m6532 d/f has two differential current inputs and three sin gle - ended voltage input s . maximum design flexibility is provided by multiple uarts, i 2 c, wire, up to 21 dio pins and in - system pro grammable flash memory, which can be updated with data or application code in operation. a complete array of ice and development tools, programming libraries and reference designs enable rapid development and c ertification of tou, amr and prepay meters that comply with worldwide electricity metering stan dards. features ? wh accuracy < 0.1 % over 2000:1 current range ? exceeds iec62053/ ansi c 1 2.20 standards ? four sensor inputs ? low - jitter wh and varh plus two addi tional pulse test out puts (4 total, 10 khz maximum) with pulse count ? four - quadrant metering ? tamper detection ( neutr al current with ct, rogowski or shunt , m agnetic tamper in put ) ? line frequency count for rtc ? digital temperature compensation ? sag detection f or phase a and b ? independent 32 - bit compute engine ? 46- 64 hz line frequency range with same calibration . phase compensation ( 7 ) ? three battery modes with wake - up on timer or push - button: brownout mode (52 a typ. ) lcd mode (2 1 a typ. , dac active ) sleep mode (0.7 a typ. ) ? energy display during main s power failure ? 39 mw typical consumption @ 3.3 v, mpu clock frequency 614 khz ? 22- bit delta - sigma adc with 3360 hz or 2520 hz sample rate ? 8 - bit mpu (80515),1 clock cycle per in struction , 10 mhz maxi mum, with integrated ice for debug ? rtc for tou functions with clock - rate adjust register ? hardware watchdog timer, power fail monitor ? lcd driver with 4 common segment drivers : u p to 156 (71m6531d/f) or 268 pixels (71m6532d/f) ? up to 22 (71m6531 d/f ) or 43 ( 71m6532 d/f ) general - purpose i/o pins. digital i/o pins compatible with 5 v inputs ? 32 khz time base ? high - speed slave spi interface to data ram ? two uarts for ir and amr , ir driver with modulation ? flash memory with security and in - system program update : 128 kb (71m6531 d /32d ) 256 kb (71m6531 f/ 32 f) ? 4 kb mpu xram ? industrial temperature range ? 68- pin qfn package for 71m6531d/f pin - compatible with 71m6521 , 100- pin lqfp package for 71m6532 d/f , lead free mpu timers iap* va ibp* xin xout vref rx/dio1 tx/dio2 v1 tx rx com0..3 v3.3a v3.3 sys vbat v2.5 vbias gnda gndd seg/dio ice i/f load 88. 88. 8888 i2c or wire eeprom power fault amr test pulses comparator sense drive/mod serial ports osc/pll adc lcd & dio compute engine flash memory ram voltage ref regulator power supply teridian 71m6531 71m6532 temp sensor 32 khz a neutral ct/shunt 02/18/2009 vb b load ir pwr mode control wake-up battery ice_e gndd v3p3d ian* ibn* ct spi host spi lcd seg rtc * differential pins only on 6532d/f
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 2 ? 2005 - 2010 teridian semiconductor corporation v1.3 table of contents 1 hardware description ................................ ................................ ................................ ....................... 10 1.1 hardware overview ................................ ................................ ................................ ................... 10 1.2 analog front end (afe) ................................ ................................ ................................ ............. 10 1.2.1 signal input pins ................................ ................................ ................................ ............ 10 1.2.2 input multiplexer ................................ ................................ ................................ ............ 11 1.2.3 a/d converter (adc) ................................ ................................ ................................ ..... 12 1.2.4 fir filter ................................ ................................ ................................ ........................ 12 1.2.5 voltage references ................................ ................................ ................................ ....... 12 1.2.6 temperature sensor ................................ ................................ ................................ ...... 14 1.2.7 battery monitor ................................ ................................ ................................ ............... 14 1.2.8 afe functional description ................................ ................................ ........................... 14 1.2.9 digital computation engine (ce) ................................ ................................ ................... 15 1.2.10 meter equations ................................ ................................ ................................ ............. 16 1.2.11 real - time monitor ................................ ................................ ................................ ......... 16 1.2.12 pulse generators ................................ ................................ ................................ ........... 16 1.2.13 data ram (xram) ................................ ................................ ................................ ........ 17 1.2.14 delay compensation ................................ ................................ ................................ ..... 17 1.2.15 ce functional overview ................................ ................................ ................................ 17 1.3 80515 mpu core ................................ ................................ ................................ ....................... 19 1.3.1 memory organization and addressing ................................ ................................ .......... 19 1.3.2 special function registers (sfrs) ................................ ................................ ............... 21 1.3.3 generic 80515 special function registers ................................ ................................ ... 22 1.3.4 special function registers (s frs) specific to the 71m6531d/f and 71m6532d/f ..... 24 1.3.5 instruction set ................................ ................................ ................................ ................ 26 1.3.6 uarts ................................ ................................ ................................ ........................... 26 1.3.7 timers and counters ................................ ................................ ................................ ..... 28 1.3.8 wd timer (software watchdog timer) ................................ ................................ ......... 30 1.3.9 interrupts ................................ ................................ ................................ ........................ 30 1.4 on - chip resources ................................ ................................ ................................ ................... 36 1.4.1 oscillator ................................ ................................ ................................ ........................ 36 1.4.2 internal clocks ................................ ................................ ................................ ............... 36 1.4.3 real - time clock (rtc) ................................ ................................ ................................ . 37 1.4.4 temperature sensor ................................ ................................ ................................ ...... 38 1.4.5 physical memory ................................ ................................ ................................ ............ 38 1.4.6 optical interface ................................ ................................ ................................ ............. 40 1.4.7 digital i/o ? 71m6531d/f ................................ ................................ .............................. 41 1.4.8 digital i/o ? 71m6532d /f ................................ ................................ .............................. 43 1.4.9 digital io ? common characteristics for 71m6531d/f and 71m6532d/f .................... 44 1.4.10 lcd drivers ? 71m6531d/f ................................ ................................ .......................... 45 1.4.11 lcd drivers ? 71m6532d/f ................................ ................................ .......................... 46 1.4.12 lcd drivers ? common characteristics for 71m6531d/f and 71m6532d/f ............... 46 1.4.13 battery monitor ................................ ................................ ................................ ............... 46 1.4.14 eeprom interface ................................ ................................ ................................ ........ 46 1.4.15 spi slave port ................................ ................................ ................................ ................ 49 1.4.16 hardware watchdog timer ................................ ................................ ............................ 52 1.4.17 test ports (tmuxout pin) ................................ ................................ ........................... 53
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 3 2 functional description ................................ ................................ ................................ ..................... 54 2.1 theory of operation ................................ ................................ ................................ ................... 54 2.2 system timing summary ................................ ................................ ................................ ........... 55 2.3 battery modes ................................ ................................ ................................ ............................ 56 2.3.1 brownout mode ................................ ................................ ................................ ....... 57 2.3.2 lcd mode ................................ ................................ ................................ ...................... 58 2.3.3 sleep mode ................................ ................................ ................................ ................. 58 2.4 fault and reset behavior ................................ ................................ ................................ .......... 60 2.4.1 reset mode ................................ ................................ ................................ .................... 60 2.4.2 power fault circuit ................................ ................................ ................................ ........ 60 2.5 wake - up behavior ................................ ................................ ................................ ..................... 61 2.5.1 wake on pb ................................ ................................ ................................ ................... 61 2.5.2 wake on timer ................................ ................................ ................................ ............... 61 2.6 data flow ................................ ................................ ................................ ................................ ... 61 2.7 ce/mpu communication ................................ ................................ ................................ ........... 62 3 application information ................................ ................................ ................................ .................... 63 3.1 connection of sensors ................................ ................................ ................................ ............... 63 3.2 connecting 5 - v devices ................................ ................................ ................................ ............ 63 3.3 temperature measurement ................................ ................................ ................................ ....... 64 3.4 temperature compensation ................................ ................................ ................................ ...... 64 3.4.1 temperature coefficients: ................................ ................................ ............................. 64 3.4.2 temperature compensation for vref ................................ ................................ .......... 65 3.4.3 system temperature compensation ................................ ................................ ............. 65 3.4.4 temperature compensation for the rtc ................................ ................................ ...... 65 3.5 connecting lcds ................................ ................................ ................................ ....................... 66 3.6 connecting i 2 c eeproms ................................ ................................ ................................ ........ 66 3.7 connecting three - wire eep roms ................................ ................................ ........................... 67 3.8 uart0 (tx/rx) ................................ ................................ ................................ ......................... 67 3.9 optical interface (uart1) ................................ ................................ ................................ .......... 67 3.10 connec ting the v1 pin ................................ ................................ ................................ ............... 68 3.11 connecting the reset pin ................................ ................................ ................................ .......... 69 3.12 connecting the emulator port pins ................................ ................................ ............................ 69 3.13 connecting a battery ................................ ................................ ................................ ................. 69 3.14 flash programming ................................ ................................ ................................ .................... 70 3.15 mpu firmware ................................ ................................ ................................ ........................... 70 3.16 crystal oscillator ................................ ................................ ................................ ........................ 70 3.17 meter calibration ................................ ................................ ................................ ........................ 71 4 firmware interface ................................ ................................ ................................ ............................ 72 4.1 i/o ram and sfr map ? functional order ................................ ................................ ............... 72 4.2 i/o ram description ? alphabetical order ................................ ................................ ................ 77 4.3 ce inter face description ................................ ................................ ................................ ............ 88 4.3.1 ce program ................................ ................................ ................................ ................... 88 4.3.2 ce data format ................................ ................................ ................................ ............. 88 4.3.3 con stants ................................ ................................ ................................ ....................... 88 4.3.4 environment ................................ ................................ ................................ ................... 88 4.3.5 ce calculations ................................ ................................ ................................ ............. 89 4.3.6 ce status a nd control ................................ ................................ ................................ ... 89 4.3.7 ce transfer variables ................................ ................................ ................................ ... 92 4.3.8 pulse generation ................................ ................................ ................................ ........... 93 4. 3.9 ce calibration parameters ................................ ................................ ............................ 94
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 4 ? 2005 - 2010 teridian semiconductor corporation v1.3 4.3.10 other ce parameters ................................ ................................ ................................ .... 95 4.3.11 ce flow diagrams ................................ ................................ ................................ ......... 95 5 electrical specifications ................................ ................................ ................................ ................... 98 5.1 absolute maximum ratings ................................ ................................ ................................ ....... 98 5.2 recommended external components ................................ ................................ ....................... 99 5.3 recommended operating conditions ................................ ................................ ........................ 99 5.4 performance specifications ................................ ................................ ................................ ..... 100 5.4.1 input l ogic levels ................................ ................................ ................................ ........ 100 5.4.2 output logic levels ................................ ................................ ................................ ..... 100 5.4.3 power - fault comparator ................................ ................................ ............................. 100 5.4.4 battery monitor ................................ ................................ ................................ ............. 100 5.4.5 supply current ................................ ................................ ................................ ............. 101 5.4.6 v3p3d switch ................................ ................................ ................................ .............. 101 5.4.7 2.5 v voltage regulator ................................ ................................ ............................... 101 5.4.8 low - power voltage regulator ................................ ................................ ..................... 101 5.4.9 crystal oscillator ................................ ................................ ................................ .......... 102 5.4.10 lcd dac ................................ ................................ ................................ ..................... 102 5.4.11 lcd drivers ................................ ................................ ................................ ................. 102 5.4.12 optical interface ................................ ................................ ................................ ........... 102 5.4.13 temperature sensor ................................ ................................ ................................ .... 103 5.4.14 vref ................................ ................................ ................................ ........................... 103 5.4.15 adc converter, v3p3a referenced ................................ ................................ ........... 104 5.5 timing specifications ................................ ................................ ................................ ............... 105 5.5.1 flash memory ................................ ................................ ................................ .............. 105 5.5.2 eeprom interface ................................ ................................ ................................ ...... 105 5.5.3 reset ................................ ................................ ................................ ......................... 105 5.5.4 rtc ................................ ................................ ................................ .............................. 105 5.5.5 spi slave port (mission mode) ................................ ................................ ................. 106 5.6 typical performance data ................................ ................................ ................................ ....... 107 5.6.1 accuracy over current ................................ ................................ ................................ . 107 5.6.2 accuracy o ver temperature ................................ ................................ ........................ 107 5.7 71m6531d/f package ................................ ................................ ................................ ............. 108 5.7.1 package outline ................................ ................................ ................................ .......... 108 5.7.2 71m6531d/f pinout (qfn - 68) ................................ ................................ ..................... 109 5.7.3 recommended pcb land pattern for the qfn - 68 package ................................ ...... 110 5.8 71m6532d/f package ................................ ................................ ................................ ............. 111 5.8.1 71m6532d/f pinout (lqfp - 100) ................................ ................................ ................. 111 5.8.2 lqfp - 100 mechanical drawing ................................ ................................ ................... 112 5.9 pin descriptions ................................ ................................ ................................ ....................... 113 5.9.1 power and ground pins ................................ ................................ ............................... 113 5.9.2 analog pins ................................ ................................ ................................ .................. 113 5.9.3 digital pins ................................ ................................ ................................ ................... 114 5.9.4 i/o equivalent circuits ................................ ................................ ................................ . 115 6 ordering information ................................ ................................ ................................ ...................... 116 7 related information ................................ ................................ ................................ ........................ 116 8 contact information ................................ ................................ ................................ ........................ 116 appendix a: acronyms ................................ ................................ ................................ .......................... 117 appendix b: revision history ................................ ................................ ................................ ............... 118
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 5 figures figure 1: 71m6531d/f ic functional block diagram ................................ ................................ ................... 8 figure 2: 71m6532d/f ic functional block diagram ................................ ................................ ................... 9 figure 3: general topology of a chopped amplifier ................................ ................................ .................. 13 figure 4: cross signal with chop_e[1:0] = 00 ................................ ................................ ....................... 13 figure 5: afe block diagram (shown for the 71m6532d/f) ................................ ................................ ...... 14 figure 6: samples from multiplexer cycle ................................ ................................ ................................ .. 18 figure 7: accumulation interval ................................ ................................ ................................ .................. 18 figure 8: interrupt structure ................................ ................................ ................................ ........................ 35 figure 9: optical interface ................................ ................................ ................................ ........................... 41 figure 10: connecting an external load to dio pins ................................ ................................ ................. 45 figure 11: 3 - wire interface. write command, hiz=0 ................................ ................................ ................ 48 figure 12: 3 - wire interface. write command, hiz=1 ................................ ................................ ................ 48 figure 13: 3 - wire interface. read command. ................................ ................................ ........................... 49 figure 14: 3 - wire interface. write command when cnt=0 ................................ ................................ ...... 49 figure 15: 3 - wire interface. write command when hiz=1 and wfr=1 ................................ ................... 49 figure 16: spi slave port: typical read and write operations ................................ ................................ .. 51 figure 17: functions defined by v1 ................................ ................................ ................................ ............ 52 figure 18: voltage, curr ent, momentary and accumulated energy ................................ ........................... 54 figure 19: timing relationship between adc mux, compute engine ................................ ...................... 55 figure 20: rtm output forma t ................................ ................................ ................................ ................... 55 figure 21: operation modes state diagram ................................ ................................ ............................... 56 figure 22: transition from brownout to mission mode when system power returns ...................... 59 figure 23: power - up timing with v3p3sys and vbat tied together ................................ ........................ 59 figure 24: power - up timing with vbat only ................................ ................................ .............................. 60 figure 25: wake up timing ................................ ................................ ................................ ........................ 61 figure 26: mpu/ce data flow ................................ ................................ ................................ .................... 62 figure 27: mpu/ce communication ................................ ................................ ................................ ........... 62 figure 28: resistive voltage divider ................................ ................................ ................................ ........... 63 figure 29: ct with single ended (left) and differential input (right) connection ................................ ..... 63 figure 30: resistive shunt (left) and rogowski sensor (right) connection ................................ ............. 63 figure 31: connecting lcds ................................ ................................ ................................ ....................... 66 figure 32: i 2 c eeprom connection ................................ ................................ ................................ .......... 66 figure 33: three - wire eeprom connection ................................ ................................ ............................. 67 figure 34: connections for uart0 ................................ ................................ ................................ ............. 67 figure 35: connection for optical components ................................ ................................ .......................... 68 figure 36: voltage divider for v1 ................................ ................................ ................................ ................ 68 figure 37: external components for the reset pin: push - button (left), production circuit (right) ........ 69 figure 38: external components for the emulator interface ................................ ................................ ...... 69 figure 39: connecting a battery ................................ ................................ ................................ ................. 70 figure 40: ce data flow: multiplexer and adc ................................ ................................ .......................... 96 figure 41: ce data flow: scaling, gain control, intermediate variables ................................ .................. 96 figure 42: ce data flow: squaring and summation stages ................................ ................................ ...... 97 figure 43: spi slave port (mission mode) timing ................................ ................................ ................. 106 figure 44: wh accuracy, 0.1 a to 200 a at 240 v/50 hz and room temperature ................................ .. 107 figure 45: qfn - 68 package outline, top and side view ................................ ................................ ........ 108 figure 46: qfn - 68 package outline, bottom view ................................ ................................ .................. 108 figure 47: pinout for qfn - 68 package ................................ ................................ ................................ ..... 109 figure 48: pcb land pattern for qfn 68 package ................................ ................................ .................. 110 figure 49: pcb land pattern for lqfp - 100 package ................................ ................................ .............. 111 figure 50: lqfp - 100 package, mechanical drawing ................................ ................................ ............... 112 figure 51: i/o equivalent circuits ................................ ................................ ................................ ............. 115
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 6 ? 2005 - 2010 teridian semiconductor corporation v1.3 tables table 1: inputs selected in regular and alternate multiplexer cycles ................................ ....................... 11 table 2: adc resolution ................................ ................................ ................................ ............................. 12 table 3: adc ram locations ................................ ................................ ................................ ..................... 12 table 4: xram locations for adc results ................................ ................................ ................................ 15 table 5: meter equations ................................ ................................ ................................ ............................ 16 table 6: ckmpu clock frequencies ................................ ................................ ................................ .......... 19 table 7: memory map ................................ ................................ ................................ ................................ . 20 table 8: internal data memory map ................................ ................................ ................................ ........... 21 table 9: special function register map ................................ ................................ ................................ ..... 21 table 10: generic 80515 sfrs - location and reset values ................................ ................................ .... 22 table 11: psw bit functions ( sfr 0xd0 ) ................................ ................................ ................................ ..... 23 table 12: port registers ................................ ................................ ................................ ............................. 24 table 13: stretch memory cycle width ................................ ................................ ................................ ...... 24 table 14: 71m6531d/f and 71m6532d/f specific sfrs ................................ ................................ ........... 24 table 15: baud rate generation ................................ ................................ ................................ ................ 26 table 16 : uart modes ................................ ................................ ................................ ............................... 26 table 17: the s0con (uart0) register (sfr 0x98) ................................ ................................ ................. 27 table 18: the s1con (uart1) register (sfr 0x9b) ................................ ................................ .................. 27 table 19: pcon register bit description (sfr 0x87) ................................ ................................ ................ 28 table 20: timers/counters mode description ................................ ................................ ............................ 28 table 21: allowed timer/counter mode combinations ................................ ................................ .............. 29 table 22: tmod register bit description (sfr 0x89) ................................ ................................ ................ 29 table 23: the tc on register bit functions (sfr 0x88) ................................ ................................ ............ 29 table 24: the ien0 bit functions (sfr 0xa8) ................................ ................................ ............................ 30 table 25: the ien1 bit functions (sfr 0xb8) ................................ ................................ ............................ 31 table 26: the ien2 bit functions (sfr 0x9a) ................................ ................................ ............................ 31 table 27: tcon bit functions (sfr 0x88) ................................ ................................ ................................ . 31 table 28: the t2con b it functions (sfr 0xc8) ................................ ................................ ........................ 31 table 29: the ircon bit functions (sfr 0xc0) ................................ ................................ ........................ 31 table 30: external mp u interrupts ................................ ................................ ................................ .............. 32 table 31: interrupt enable and flag bits ................................ ................................ ................................ .... 32 table 32: interrupt priority level groups ................................ ................................ ................................ .... 3 3 table 33: interrupt priority levels ................................ ................................ ................................ ............... 33 table 34: interrupt priority registers ( ip0 and ip1 ) ................................ ................................ .................... 34 table 3 5: interrupt polling sequence ................................ ................................ ................................ .......... 34 table 36: interrupt vectors ................................ ................................ ................................ .......................... 34 table 37: clock system summary ................................ ................................ ................................ .............. 36 table 38: bank switching with fl_bank[2:0] ................................ ................................ ............................ 40 table 39: data/direction registers and internal resources for dio 1 - 15 (71m6531d/f) ......................... 42 table 40: data/direction registers and internal resources for dio 17 - 29 (71m6531d/f) ....................... 42 table 41: data/direction registers and internal resources for dio 43 - 46 (71m6531d/f ) ....................... 42 table 42: data/direction registers and internal resources for dio 1 - 15 (71m6532d/f) ......................... 43 table 43: data/direction registers and int ernal resources for dio 16 - 30 (71m6532d/f) ....................... 43 table 44: data/direction registers and internal resources for dio 40 - 51 (71m6532d/f) ....................... 44 table 45: dio_dir control bit ................................ ................................ ................................ .................... 44 table 46: selectable control using dio_dir bits ................................ ................................ ......................... 44 table 47: eectrl bits for 2 - pin interface ................................ ................................ ................................ ... 47 table 48: eectrl bits for the 3 - wire interface ................................ ................................ .......................... 48 table 49: spi command description ................................ ................................ ................................ .......... 50 table 50: i/o ram registers accessible via spi ................................ ................................ ....................... 50 table 51: tmux[4:0] selections ................................ ................................ ................................ ................. 53 table 52: available circuit functions ................................ ................................ ................................ .......... 57
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 7 table 53: i/o ram map in functional order ................................ ................................ ............................... 72 table 54: i/o ram description - alphabetical ................................ ................................ ............................ 77 table 55: ce equ[2:0] equations and element input mapping ................................ ................................ . 89 table 56: cestatus (ce ram 0x80) bit definitions ................................ ................................ .................. 90 t able 57: ceconfig bit definitions ................................ ................................ ................................ ........... 91 table 58: sag threshold control ................................ ................................ ................................ ................ 91 table 59: gain adjust control ................................ ................................ ................................ ..................... 91 table 60: ce transfer variables ................................ ................................ ................................ ................. 92 table 61: ce energy measurement variables ................................ ................................ ............................ 92 table 62: useful ce me asurement parameters ................................ ................................ ......................... 93 table 63: ce pulse generation parameters ................................ ................................ ............................... 94 table 64: ce calibration parameters ................................ ................................ ................................ ......... 94 table 65: ce parameters for noise suppression and code version ................................ ......................... 95 table 66: absolute maximum ratings ................................ ................................ ................................ ........ 98 table 67: recommended external components ................................ ................................ ........................ 99 table 68: recommended operating conditions ................................ ................................ ......................... 99 table 69: input logic levels ................................ ................................ ................................ ..................... 100 table 70: output logic levels ................................ ................................ ................................ .................. 100 table 71: power - fault comparator performance specifications ................................ ............................. 100 table 72: battery monitor performance specifications ( bme = 1) ................................ ............................. 100 table 73: supply current performance specifications ................................ ................................ ............. 101 table 74: v3p3d switch performance specifications ................................ ................................ .............. 101 table 75: 2.5 v voltage regulator performance specifications ................................ ............................... 101 table 7 6: low - power voltage regulator performance specifications ................................ ..................... 101 table 77: crystal oscillator performance specifications ................................ ................................ .......... 102 table 78: lc d dac performance specifications ................................ ................................ ..................... 102 table 79: lcd driver performance specifications ................................ ................................ ................... 102 table 80: optical interface performance speci fications ................................ ................................ ........... 102 table 81: temperature sensor performance specifications ................................ ................................ .... 103 table 82: vref performance specifications ................................ ................................ ............................ 103 table 83: adc converter performance specifications ................................ ................................ ............. 104 table 84: flash memory timing specifications ................................ ................................ ........................ 105 table 85: eeprom interface timing ................................ ................................ ................................ ........ 105 table 86: reset timing ................................ ................................ ................................ .......................... 105 table 87: spi slave port (mission mode) timing ................................ ................................ .................. 106 table 88: recommended pcb land pattern dimensions ................................ ................................ ........ 110 table 89: power and ground pins ................................ ................................ ................................ ............ 113 table 90: analog pins ................................ ................................ ................................ ............................... 113 table 91: digital pins ................................ ................................ ................................ ................................ 114
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 8 ? 2005 - 2010 teridian semiconductor corporation v1.3 figure 1 : 71m6531d/f ic functional block diagram ? adc converter vref adc_e mux xin xout vref dio1/opt_rx reset v1 uart2--optical uart1 tx rx 4 com0...3 lcd display driver digital i/o rtclk (32khz) ce_e rtm_e power fault lcd_e lcd_clk lcd_mode dio gndd v3p3a v3p3d vbat volt reg 2.5v to logic v2p5 sum_cycles pre_samps equ tmuxout faultz tmux[4:0] gnda vbias osc (32khz) mck pll vref vref_dis test test mode dio_r dio_dir e_rxtx opt_txe rtc vbias ice_e vref_cal rtm_0..3 ce_lctn pls_maxwidth pls_interval pls_inv opt_txinv opt_txmod opt_fdc opt_rxinv opt_rxdis lcd_blkmap lcd_seg lcd_y sleep lcd_only v3p3sys test mux vbat ce_prog ck_ce ck_mpu vadc ce multi- purpose io mux_div mux_alt equ rtm rpulse wpulse com0..3 seg... dio... to tmux spi slave pcmd eeprom eectrl flash 128kb/ 256kb xram 4kb ce_data pcsz pclk psi pso sdata sclk eedata opt_tx opt_rx pb pb iram 256b mpu emulator (ice) e_tclk e_rstz dio2/opt_tx/wpulse/rpulse seg7/mux_sync seg8 seg9/e_rxtx seg10/e_tclk seg11/e_rst seg12 seg13 seg14 seg16 seg15 seg17 dio4/seg24/sdck dio5/seg25/sdata dio6/seg26/wpulse dio7/seg27/rpulse dio10/seg30 rpulse wpulse 4 xram bus 8 iram bus 16 32 22 cktest dio_pv dio_pw ckout_e mux_sync_e spe dio_eex opt_txe ice_e ckout_e seg0 seg1 seg2 seg3/pclk seg4/psdo seg5/pcsz seg6/psdi fir fir_len va ib vb ia dio12/seg32 dio11/seg31 xpulse ypulse xpulse ypulse dio_px dio_py dio8/seg28/xpulse dio9/seg29/ypulse seg18 seg19/cktest dio44/seg64 dio43/seg63 dio29/seg49 dio28/seg48 dio13/seg33 dio14/seg34 dio15/seg35 dio46/seg66 dio45/seg65 dio17/seg37 lcd_dac rtca_adj preg qreg rst_subsec rtc_sec rtc_min rtc_hr rtc_day rtc_date rtc_mo rtc_yr 05/26/2010 nvram gp0-gp7 2.5v_nv 2.5v_nv 2.5v_nv 2.5v_nv temp sensor 8 8
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 9 figure 2 : 71m6532d/f ic functional block diagram ? adc converter vref adc_e mux xin xout vref dio1/opt_rx reset v1 uart2--optical uart1 tx rx 4 com0...3 lcd display driver digital i/o rtclk (32khz) ce_e rtm_e power fault lcd_e lcd_clk lcd_mode dio gndd v3p3a v3p3d vbat volt reg 2.5v to logic v2p5 sum_cycles pre_samps equ tmuxout faultz tmux[4:0] gnda vbias temp sensor osc (32khz) mck pll vref vref_dis test test mode dio_r dio_dir e_rxtx opt_txe rtc vbias ice_e vref_cal rtm_0..3 ce_lctn pls_maxwidth pls_interval pls_inv opt_txinv opt_txmod opt_fdc opt_rxinv opt_rxdis lcd_blkmap lcd_seg lcd_y sleep lcd_only v3p3sys test mux vbat ce_prog ck_ce ck_mpu vadc ce multi- purpose io mux_div mux_alt equ rtm rpulse wpulse com0..3 seg... dio... to tmux spi slave pcmd eeprom eectrl flash 128kb/ 256kb xram 4kb ce_data pcsz pclk psi pso sdata sclk eedata opt_tx opt_rx pb pb iram 256b mpu emulator e_tclk e_rstz dio2/opt_tx/wpulse/rpulse seg7/mux_sync seg8 seg9/e_rxtx seg10/e_tclk seg11/e_rst seg12...seg18 dio4/seg24/sdck dio5/seg25/sdata dio6/seg26 /wpulse dio7/seg27/rpulse rpulse wpulse 4 xram bus 8 iram bus 8 16 32 22 cktest dio_pv dio_pw ckout_e mux_sync_e spe dio_eex opt_txe ice_e ckout_e seg0...seg2 seg3/pclk seg4/psdo seg5/pcsz seg6/psdi fir fir_len va ibp vb iap xpulse ypulse xpulse ypulse dio_px dio_py dio8/seg28/xpulse dio9/seg 29/ypulse seg19/cktest lcd_dac rtca_adj preg qreg rst_subsec rtc_sec rtc_min rtc_hr rtc_day rtc_date rtc_mo rtc_yr 05/26/2010 nvram gp0-gp7 2.5v_nv 2.5v_nv 2.5v_nv 2.5v_nv ian ibn seg20...seg23 dio10/seg30...dio27/seg47 dio29/seg59 dio30/seg50 dio40/seg60 ...dio45/seg65 dio47/seg67...dio51/seg71 dio56...dio58 dio3 4 7 3 3 18 6 5
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 10 ? 2005 - 2010 teridian semiconductor corporation v1.3 1 hardware description 1.1 hardware overview the teridian 71m6531 d/f and 71m6532d/f single - chip energy meter s integrate s all primary functional blocks required to implement a solid - state electricity meter. included on the chip s are : ? an a nalog front end (afe) ? an i ndependent digital computation engine (ce) ? an 8051 - compatible microprocessor (mpu) which executes one inst ruction per clock cycle (80515) ? a voltage reference ? a temperature sensor ? lcd drivers ? ram and flash memory ? a real time clock (rtc) ? a variety of i/o pi ns various current sensor technologies are supported including current transformers (ct), resistive shunts and rogowski coils. in a typical application, the 32 - bit compute engine (ce) of the 71m6531 d/f and 71m6532d/f sequentially process the samples from the voltage inputs on pins ia, va, ib, vb and performs calculations to measure active ener gy (wh) and reactive energy (varh), as well as a 2 h and v 2 h for four - quadrant metering. these measure ments are then accessed by the mpu, processed further and output using the peri pheral devices available to the mpu. in addition to advanced measurement functions, the real time clock function allows the 71m6531 d/f and 71m6532d/f to record time of use (tou ) metering information for multi - rate applications and to time - stamp tamper events. measurements can be displayed on 3.3 v lcds commonly used in low - tem perature envi ronments. flexible mapping of lcd display segments facilitate integration of existing cu stom lcds. design trade - off between the number of lcd segments and dio pins can be implemented in software to accommodate various require ments. in addition to the temperature - trimmed ultra - precision voltage reference, the on - chip digital temperature com pensation mechanism includes a temperature sensor and associated controls for correction of unwanted temperature effects on meas ure ment and rtc accuracy, e.g. to meet the requirements of ansi and iec standards . temperature - dependent external com ponents such as a crystal oscillator , current transformers (cts) and their corresponding signal conditioning circuits can be character ized and their correction factors can be programmed to produce electricity meters with exceptional accuracy over the indus trial temperature range. one of the two internal uarts is adapted to support an infrared led with interna l drive and sense configuration and can also function as a standard uart. the optical output can be modulated at 38 khz. this flexibility makes it possib le to implement amr meters with an ir interface. a block diagram of the 71m6531 d/f ic is shown in figure 1 . a block diagram of the 71m6532d/f ic is shown in figure 2 . 1.2 an alog front end (afe) the afe consists of an input multiplexer, a delta - sigma a/d converter and a voltage reference. 1.2.1 signal input pins all analog signal input pins are sensitive to voltage. in the 71m6531d/f, t he va and vb pins , as well as the ia and ib pi ns are single - ended. in the 71m6532d/f , the iap/ian and ibp/ibn pin s can be programmed individually to be differential (see i/o ram bit sel_ian and sel_ibn ) or single - ended. the differential signal is applied between the iap and ia n input pins and betwee n the ibp and ibn input pin s . single - end ed signals are applied to the iap and ibp input pin s whereas the common sig nal, return, is the v3p3a pin. when using the differen tial mode, inputs can be chopped, i. e. a connection from v3p3a to iap or ia n (or ib p an ibn, respectively) alternates in each multip lexer cycle.
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 11 1.2.2 input multiplexer the input multiplexer supports up to four input sig nals that are applied to pins ia (i ap/ian) , va, ib (ibp/ibn) , and vb of the de vice. additionally, using the alternate mult iplexer selection, it ha s the ability to select temperature and the battery voltage. the multiplexer can be operated in two modes: ? during a normal multiplexer cycle, the signals from the ia (iap/ian) , ib (ibp/ibn) , va and vb pins are selected. ? during the alternate multiplexer cycle, the temperature signal (temp) and the battery monitor are selected, along with some of the voltage and/or current signal sources shown in table 1 . to prevent unnecessary drainage on the battery, the b attery monitor is only active when enabled with the bme bit (0x2020[6]) in the i/o ram. the alternate multiplexer cycles are usually performed infrequently (every second or so) by the mpu. in order to prevent disruption of the voltage tracking pll and vol tage allpass networks, va is not replaced in the alt selections. table 1 detail s the regular and alternative multiplexer sequences. the computation engine ( ce ) fills in missing samples due to an alt multiplexer s equence . table 1 : inputs selected in regular and altern ate multiplexer cycles time slot regular slot alternate slot register typical selections register typical selections ram address signal for adc ram address signal for adc 0 slot0_sel [3:0] 0 ia slot0_altsel [3:0] a temp 1 slot1_sel [3:0] 1 v b slot1_altsel [3:0] 1 v b 2 slot2_sel [3:0] 2 ib slot2_altsel [3:0] b vbat 3 slot3_sel [3:0] 3 v a slot3_altsel [3:0] 3 v a ? slot4_sel [3:0] ? ? slot4_altsel [3:0] ? ? ? slot5_sel [3:0] ? ? slot5_altsel [3:0] ? ? ? slot6_sel [3:0] ? ? slot6_altsel [3:0] ? ? ? slot7_sel [3:0] ? ? slot7_altsel [3:0] ? ? ? slot8_sel [3:0] ? ? slot8_altsel [3:0] ? ? ? slot9_sel [3:0] ? ? slot9_altsel [3:0] ? ? the sequence of sampled channels is fully programmabl e using i/o ram registers. slotn_sel [3:0] se lects the input for the nth state in a standard multiplexer frame, while slotn_altsel [3:0] selects the input for the nth state in an alternate multiplexer frame. the states shown in table 1 are examples for possible multiplexer state sequences. in a typical application, ia (ian/iap) and ib (ibn/ibp) are connected to current transformers that sense the current on each phase of the line voltage. va and vb are typically c onnected to voltage sensors through resistor dividers. the multiplexer control circuit (mux_ctrl signal) controls multiplexer advance, fir initiation and vref chopping . additionally, mux_ctrl launches each pass through the ce program. conceptually, mux_c trl is clocked by ck32, the 32768 hz clock from the pll block. the behavior of mux_ctrl is governed by mux_alt , equ [2:0] , chop_e[1:0] and mux_div[3:0] . the mux_alt bit requests an alternative multiplexer frame. the bit may be asserted on any mpu cycle an d may be subsequently de- asserted on any cycle including the next one. a rising edge on mux_alt will cause mux_ctrl to wait until the next multiplexer frame and implement a single alternate multiplexer frame. another control input to the mux is mux_div[3: 0] . these four bits can request from 1 to 10 multiplexer states per frame. the multiplexer always starts at the beginning of its list and proceeds until the number of states defined by mux_div[3:0] have been converted.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 12 ? 2005 - 2010 teridian semiconductor corporation v1.3 the duration of each multiplexer state depends on the number of adc samples processed by the fir, which is set by fir_len[1:0] . each multiplexer state will start on the rising edge of ck32. the mux_ctrl signal sends an fir_start command to begin the calculation of a sample value from th e adc bit stream by the fir. upon receipt of the fir_done signal from the fir, the multiplexer will wait until the next ck32 rising edge to increment its state and initiate the next fir conversion. fir conversions require 1, 2, or 3 ck32 cycles. the num ber of ck32 cycles is determined by fir_len[1:0] , as shown in table 2 . 1.2.3 a/d converter (adc) a single delta - sigma a/d converter digitizes the voltage and current inputs to the 71m6531 d / f and 71m6532d/f . the resolut ion of the adc is programmable using the i/o ram m40mhz and m26mhz bits (see table 2 ). the ce code must be tailored for use with the selected adc resolution. table 2 : adc resolution setting for [ m40mhz, m26mhz ] fir_len[1:0] ck 32 cycles fir ce cycles resolution [00], [10] or [11] 0 1 2 1 2 3 138 288 384 18 bits 21 bits 22 bits [01] 0 1 2 1 2 3 186 384 588 19 bits 22 bits 24 bits initiation of each adc conversion is controlled by mux_ctrl as described above. at the end of each adc conversion, the fir filter output data is stored into the ce ram location determined by the mux selection. 1.2.4 fir filter the finite impulse response filter is an integral part of the adc and it is optimized for us e with the multiplexer. the purpose of the fir filter is to decimate the adc output to the desired resolution. at the end of each adc conversion, the output data is stored into the fixed ce ram location determined by the multiplexer selection as shown in table 3 . fir data is stored lsb justified, but shifted left by eight bits. table 3 : adc ram locations address (hex) name address (hex) name 0x00 ia 0x09 aux 0x01 vb 0x0a temp 0x02 i b 0x0b vbat 0x03 va 1.2.5 voltage references the device includes an on - chip precision bandgap voltage reference that incorporates auto - zero tech niques. the reference is trimmed to minimize errors caused by component mismatch and drift. the re sult is a voltage output with a predictable temperature coefficient. the amplifier within the reference is chopper stabilized, i.e. the polarity can be switched by the mpu us ing chop_e[1:0] ( ioram 0x2002[5:4 ]). the chop_e[1:0] field enable s the mpu to operate th e chopper circuit in regula r or inverted operation, or in toggling mode. when the chopper circuit is toggled in between mul tiplexer cycles, dc offsets on the measured signals will automatically be aver aged out. the general topology of a chopped amplifier is shown in figure 3 .
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 13 figure 3 : general topology of a chopped amplifier it is assumed that an offset voltage voff appears at the positive amplifier input. with all switches, as con tr olled by cross, in the a position, the output voltage is: voutp ? voutn = g (vinp + voff ? vinn) = g (vinp ? vinn) + g voff with all switches set to the b position by applying the inverted cross signal, the output voltage is: voutn ? voutp = g (vinn ? vinp + voff) = g (vinn ? vinp) + g voff, or voutp ? voutn = g (vinp ? vinn) - g voff thus, when cross is toggled, e.g. after each multiplexer cycle, the offset will alternately appear on the output as positive and negative, which results in the offset effectiv ely being eliminated, regardless of its polarity or magnitude. when cross is high, the connection of the amplifier input devices is reversed. this preserves the over all polarity of that amplifier gain; it inverts its input offset. by alternately reversi ng the connection, the am plifier?s offset is averaged to zero. this removes the most significant long - term drift mechanism in the voltage reference. the chop_e[1:0] field control s the behavior of cross. the cross signal will reverse the amplifier conne ction in the voltage reference in order to negate the effects of its offset. on the first ck32 rising edge after the last multiplexer state of its sequence, the multiplexer will wait one additional ck32 cycle before beginning a new frame. at the beginnin g of this cycle, the value of cross will be updated according to the chop_e[1:0] field . the extra ck32 cycle allows time for the chopped vref to settle. during this cycle, muxsync is held high. the leading edge of muxsync initiates a pass through the ce pro gram sequence. the beginning of the sequence is the serial readout of the four rtm words. chop_e[1:0] has four states: positive, reverse and two toggle states. in the positive state, chop_e[1:0] = 01, cross and chop_clk are held low. in the reverse state, chop_e[1:0] = 10, cross and chop_clk are held high. in the first toggle state, chop_e[1:0] = 00, cross is automatically toggled near th e end of each multiplexer frame and an alt frame is forced during the last multiplexer frame in each sum cycle. it is desirable that cross take on alternate values during each alt frame. for this reason, if chop_e[1:0] = 00, cross will not toggle at the end of the multiplexer frame immediately preceding the alt frame in each accumulation interval . figure 4 : cross signal with chop_e[1:0] = 00 figure 4 shows cross over two accumulation interval when chop_e[1:0] = 00: at the end of the first interval, cross is low, at the end of the second interva l, cross is high. the offset error for the two temperature measurements taken during the alt multiplexer frames will be averaged to zero. note that g - + v inp v outp v outn v inn cross a b a b a b a b multiplexer frames accumulation interval n accumulation interval n+1 2 4 3 2519 2520 1 2 4 3 2519 2520 1 alternative mux cycle multiplexer frames alternative mux cycle cross cross
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 14 ? 2005 - 2010 teridian semiconductor corporation v1.3 the number of multiplexer frames in an accumulation interval is always even. operation with chop_e[1:0] = 00 does not require control of the chopping mechanism by the mpu while eliminating the offset for temperature measurement. in the second toggle state, chop_e[1:0] = 11, no alt frame is forced during the last m ultiplexer cycle in a n accumulation interval a nd cross always toggles near the end of each multiplexer frame. the internal bias voltage , vbias (typically 1.6 v) , is used by the adc when measuring the temperature and battery monitor signals. 1.2.6 temperature sensor the 71m6531 d / f and 71m6532d/f include an on - chip temperature sensor implemented as a bandgap reference. it is used to determine the die temperature . the mpu may request an alternate multiplexer cycle containing the temperature sensor output by asserting mux_alt . the primary use of the temperatu re data is to determine the magnitude of compensation required to offset the thermal drift in the system (see section 3.4 temperature compensation ). 1.2.7 battery monitor the battery voltage is measured by the adc during alternative multiplexer frames if the bme (battery measure enable) bit in the i/o ram is set. while bme is set, an on - chip 45 k ? load res istor is applied to the battery and a scaled fraction of the battery vo ltage is applied to the adc input. after each alternative mux frame, the result of the adc conversion is available at xram address 0x0b. bme is ignored and assumed zero when system power is not available (v1 < vbias). see section 5.4.4 battery monitor . 1.2.8 afe functional description the afe functions as a data acquisition system, controlled by the mpu. the main signals (ia, va, ib and vb ) are sampled, and the adc counts obtained are stored in xram where they can be accessed by the ce and, if necessary, by the mpu. alternate multiplexer cycles are initiated less frequently by the mpu to gather access to the slow temperature and battery signals. figure 5 shows the block diagram of the afe, with current inputs shown only as differential pair of pins (for the 71m6531d/f, the current input for phase a is a single pin [ia]). figure 5 : afe block diagram (sho wn for the 71m6532d/f) ? adc converter vref adc_e mux vref vbias vref vref_dis vbias vref_cal vbat vadc mux_div mux_alt equ 22 fir fir_len va ibp vb iap ian ibn temp sensor
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 15 1.3 digital computation engine (ce) the ce, a dedicated 32 - bit signal processor, performs the precision computations necessary to accurately measure energy. the ce calculations and processes include: ? multiplication of each current samp le with its associated voltage sample to obtain the energy per sample (when multiplied with the constant sample time). ? frequency - insensiti ve delay cancellation on all four channels (to compensate for the delay bet ween samples caused by the multiplexing sc heme). ? 90 phase shifter (for var calculations). ? pulse generation. ? monitoring of the input signal frequency (for frequency and phase information). ? monitoring of the input signal amplitude (for sag detection). ? scaling of the processed samples based on calib ration coefficients. ? scaling of all samples based on temperature compensation information ( 71m6532d/f only ) . the ce program resides in flash memory. common access to flash memory by ce and mpu is controlled by a memory share circuit. each ce instruction word is two bytes long. allocated flash space for the ce program cannot exceed 4096 16 - bit words ( 8 kb). the ce program counter begins a pass through the ce code each time multiplexer state 0 begins. the code pass ends when a halt instruction is execut ed. for proper operation, the code pass must be completed before the multiplexer cycle ends (see section 2.2 system timing summary ). the ce program must begin on a 1 - kb boundary of the flash address. the i/o ram register ce_lctn [7 :0] defines which 1 - kb boundary contains the ce code. thus, the first ce instruction is located at 1024* ce_lctn[7 :0]. the ce can access up to 4 kb of data ram (xram) , or 1024 32 - bit data words , starting at ram address 0x0000. the xram can be accessed by the fir filter block, the rtm circuit, the ce, and the mpu. assigned time slots are reserved for fir, and mpu, respectively, to prevent bus contention for xram data access. the mpu can read a nd write the xram as the primary means of data communication between the two processors. table 4 shows the ce addresses in xram allocated to analog inputs from the afe. table 4 : xram locat ions for adc results address (hex) name description 0x00 ia phase a current 0x01 v a phase a voltage 0x02 ib phase b current 0x03 v b phase b voltage 0x04...0x0 9 ? not used 0x0a temp temperature 0x0b vbat battery voltage the ce is aided by support h ardware to facilitate implementation of equations, pulse counters and accumulators. this hardware is controlled through i/o ram locations equ[2:0] (equation assist), the dio_pv and dio_pw (pulse count assist) bits and pre_samps[1:0] and sum_cycles[5:0] (a ccumulation assist). pre_samps[1:0] and sum_cycles [5:0] support a dual level accumulation scheme where the first accumulator accumulates results from pre_samps[1:0] samples and the second accumulator accumulates up to sum_cycles [5:0] of the first accumu lator results. the integration time for each energy output is pre_samps[1:0] * sum_cycles [5:0] /2520.6 (with mux_div[3:0] = 1). the ce hardware issues the xfer_busy interrupt when the accumulation is complete.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 16 ? 2005 - 2010 teridian semiconductor corporation v1.3 1.3.1 meter equations the 71m6531 d / f and 71m6532d/f provide hardware assistance to the ce in order to support various meter equations. this assistance is controlled through i/o ram location equ[2:0] (equation assist). the compute engine (ce) firmware for resident ial configurations implements the equation s listed in table 5 . equ[2:0] specifies the equation to be used based on the number of phases used for metering. table 5 : meter equations equ[2:0] description watt and var formula mux sequ ence alt mux sequence element 0 element 1 element 2 0 1 element, 2 w, 1 with neutral current sense va ia va ib n/a sequence is programmable with slotn_sel [3:0] sequence is programmable with slotn_ alt sel [3:0] 1 1 element, 3 w, 1 va(ia - ib)/2 n/a n/a 2 2 element, 3 w, 3 delta va ia vb ib n/a not all ce codes support all equations. 1.3.2 real - time monitor the ce contains a real - time monitor (rtm), which can be programmed to monitor four selectable xram locations at full sample rate. the four monitored locations are serially output to the tmuxout pin via the digita l output multiplexer at the beginning of each ce code pass. the rtm can be enabled and disabled with the rtm_e bit . the rtm output is clocked by cktest (pin seg19/cktest), with the clock output enabled by setting ckout_e = 1 . each rtm word is clocked ou t in 35 cycles and contains a leading flag bit. see figure 20 for the rtm output format. rtm is low when not in use. 1.3.3 pulse generator s the 71m6531 d/f and 71m6532d/f provide fou r pulse generators, rpulse, wpulse, xpulse and ypulse, as well as increased hardware support for the two original pulse generators (rpulse and wpulse) . the pulse generators can be used to output ce status indicators, sag for example , to dio pins. the polarity of the pulses may be inverted with the pls_inv bit . when this bit is set, the pulses are active high, rather than the more usual active low. pls_inv inverts all the pulse outputs. xpulse and ypulse pulses generated by the ce may be exported to the xpulse and ypulse pulse outputs. pins dio8 and dio9 are used for these pulses. generally, the xpulse and ypulse outputs are updated once on each pass of the ce code, resulting in a pulse frequency up to a maximum of 1260hz (assuming a mux frame is 13 ck32 cycles). the ypulse pin can be u sed by the ce code to generate interrupts based on sag events. this method is faster than checking the sag bits by the mpu at every ce_busy interrupt. see section 4.3.6 ce status and control for details. rpulse and wpulse during each ce code pass, the hardware stores exported wpul se and rpulse sign bits in an 8 - bit fifo and outputs them at a specified interval. this permits the ce code to calculate the rpulse and wpul se outputs at the beginning of it s code pass and to rely on hardware to spread them over the mux frame. the fifo is reset at the beginning of each mux frame. the pls_interval register controls the delay to the first pulse update and the interval between subsequent updates. its lsb is 4 ck_fir cycles. if zero, the fifo is deactivated and the dffs are updated immediately. thus, n interval is 4 * pls_interval .
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 17 since the fifo resets at the beginning of each mux frame, the user must specify pls_interva l so t hat all of the pulse updates are output before hardware also provides a maximum pulse width feature. the pls_maxwidth register s elects a maxi mum negative pulse width to be nmax updates according to the formula: nmax = (2* pls_maxwidth +1). if pls_maxwidth = 255, no width checking is performed. the mux frame completes. for instance, if the ce code outputs 5 updates per mux interval and if the mux interval is 1950 cycles long, the ideal value for the interval is 1950/5/4 = 97.5. if pls_interval = 98 , the fifth output will occur too late and be lost. in this case, the proper value for pls_interval is 97. the wpulse and rpulse pulse generator outputs are available on dio6 and dio 7, respectively. they can also be output on opt_tx (see opt_txe[1:0] for details ). 1.3.4 data ram (xram) the ce and mpu use a single general - purpose data ram (also referred to as xram) . the data ram is 1024 32 - bit words, sh ared between the ce and the mpu using a time - multiplex method. this reduces mpu wait states when accessing ce data . when the mpu and ce are clocking at maximum frequency (10 mhz), the dram will make up to four accesses during each 100 ns interval. these consist of two mpu accesses, one ce access and one spi access. the data ram is 32 bits wide and uses an external multiplexer so as to appear byte - wide to the mpu. the data ram hardware will convert a n mpu byte write operation into a read - modify - write operation that requires two data ram accesses. the second access is guaranteed to be available because the mpu cann ot access the xram on two consecutive instructions unless it is using the same address. in addition to the reduction of wait states, this arrangement permits the mpu to easily use unneeded ce data memory. likewise, the amount of memory the ce uses is not limited by the size of a dedicated ce data ram. 1.3.5 delay compensation when measuring the energy of a phase (i.e., wh and varh) in a service, the voltage and current for that phase must be sampled at the same instant. otherwise, the phase difference, , introduces errors. o delay o delay f t t t 360 360 ? ? = ? = where f is the frequency of th e input signal and t delay is the sampling delay between voltage and current. in t radition al meter ics, sampling is accomplished by using two a/d converters per phase (one for voltage and the other one for current) controlled to sample simultaneously. ter idian?s patented single - converter technology ? , however, ex ploits the 32 - bit signal processing capability of its ce to implement ?constant delay? all - pass filters. the se all - pass filter s correct for the conversion time difference between the voltage and th e corresponding current samples that are obtained with a single multiplexed a/d converter. the ?constant delay? all - pass filter s provide a broad - band delay , that is precisely matched to the differ - ence in sample time between the voltage and the current o f a given phase. this digital filter does not a f- fect the amplitude of the signal, but provides a precisely controlled phase response. the delay compe n- sation implemented in the ce aligns the voltage samples with their corresponding current samples by rout ing the voltage samples through the all - pass filter, thus delaying the voltage samples by , resulting in the residual phase error ? . the residual phase error is negligible, and is typically less than 1.5 milli - degrees at 100hz, thus it does not cont ribute to errors in the energy measurements. 1.3.6 ce functional overview the adc processes one sample per channel per multiplexer cycle. figure 6 shows the timing of the samples taken during one multiplexer cycle. the number of samples processed during one accumulation cycle is controlled by pre_samps[1:0] ( ioram 0x2001[7:6] ) and sum_cycles [5:0] ( ioram 0x2001[5:0] ). the integration time for each energy output is : pre_samps[1:0] * sum_cycles[5:0] / 2520.6, where 2520.6 is the sample rate [hz]
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 18 ? 2005 - 2010 teridian semiconductor corporation v1.3 for example, pre_samps[1:0] = 42 and sum_cycles[5:0] = 50 will establish 2100 samples per accumulation cycle. pre_samps[1:0] = 100 and sum_cycles[5:0] = 21 will result in the exact same accumulation cycle of 2100 samples or 833 ms . after an accumulation cycle is completed, the xfer_busy interrupt signals to the mpu that accumulated data are available. figure 6 : samples from multiplexer cycle the end of each multiplexer cycle is signaled to the mpu by th e ce_busy interrupt. at th e end of each multiplexer cycle status information, such as sag data and the digitized input signal, is available to the mpu. figure 7 : accumulation interval fi gure 7 shows the accumulation interval resulting from pre_samps[1:0] = 42 and sum_cycles[5:0] = 50, consisting of 2100 samples of 397 s each, followed by the xfer_busy interrupt. the sampling in this example is applied to a 50 hz signal. there is no cor relation between the line signal frequency and the choice of pre_samps[1:0] or sum_cycles[5:0] ( even though when sum_cycles[5:0] = 42 one set of sum_cycles[5:0] happens to sample a period of 16.6 ms). furthermore, sampling does not have to start when the line voltage crosses the zero line and the length of the accumulation interval need not be an integer multiple of the signal cycles. va ia 1/32768hz = 30.518s 13/32768hz = 397s per mux cycle ib vb xfer_busy interrupt to mpu 20ms 833ms
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 19 1.4 80515 mpu core the 71m6531 d / f and 71m6532d/f inc lude an 80515 mpu (8 - bit, 8051 - compatible) that processes most in structi ons in one clock cycle. using a 10 - mhz clock results in a processing throughput of 10 mips. the 80515 architecture eliminates redundant bus states and im plements parallel execution of fetch and execu tion phases. normally , a machine cycle is aligned wi th a memory fetch, there fore, most of the 1 - byte in structions are performed in a single machine cycle (mpu clock cycle) . this leads to an 8x average p erfor mance im prove ment (in terms of mips) over the intel ? 8051 device running at the same clock freq uency . table 6 shows the ckmpu frequency as a function of the allowed combinations of the mpu clock divider mpu_div[2:0] and the mck divider bits m40mhz and m26mhz . actual processor clocking speed can be adjusted to the total processing demand of the application (metering calculations, amr manage ment, mem o- ry management, lcd driver management and i/o management) using the i/o ram field mpu_div[2:0] and the mck divider bits m40mhz and m26mhz , as shown in table 6 . table 6 : ckmpu clock frequencies mpu_div [2:0] [ m40mhz, m26mhz ] values [1,0] [0,1] [0,0] 000 9.8304 mhz 6.5536 mhz 4.9152 mhz 001 4.9152 mhz 3.2768 mhz 2.4576 mhz 010 2.4576 mhz 1.6384 mhz 1.2288 mhz 011 1.2288 mhz 819.2 khz 614.4 khz 100 61 4.4 khz 409.6 khz 307.2 khz 101 307.2 khz 204.8 khz 153.6 khz 110 153.6 khz 102.4 khz 76.80 khz 111 153.6 khz 102.4 khz 76.8 khz typical measurement and metering functions based on the results provided by the internal 32 - bit com pute engine (ce) are available for the mpu as part of teridian ?s standard library. teridian provides demonstration source code to help reduce the design cycle. 1.4.1 memory organization and addressing the 80515 mpu core inco rporates the harvard architecture with separate code and data spaces. memory organization in the 80515 is similar to that of the industry standard 8051 . there are four memory areas: program memory (flash, shared by mpu and ce), external ram (data ram, sh ared by the ce and mpu, configuration or i/o ram ), and internal data memory (internal ram) . table 7 shows the memory map. program memory the 80515 can address up to 64 kb of program memory space from 0x0000 to 0x ffff. program memory is read when the mpu fetches instructions or performs a movc operation. access to program memory above 0x7fff is controlled by the fl_bank[2:0] register (sfr 0xb6). after reset, the mpu starts program execution from program memory lo cation 0x0000. the lower part of the program memory includes reset and interrupt vectors. the interrupt vectors are spaced at 8 - byte in tervals, starting from 0x0003. mpu external data memory (xram) both internal and external memory is physically located on the 71m65 31 device . the e x ternal memory referred to in this documentation is only external to the 80515 mpu core. 4 kb of ram starting at address 0x0000 is shared by the ce and mpu. the ce normally uses the first 1 kb, leaving 3 kb for the mpu. different versions of the ce code use varying amounts. consult the documentation for the specific code version being used for the exact limit. if the mpu overwrites the ce?s working ram, the ce?s output may be corrupted. if the ce is disabled, the firs t 0x40 bytes of ram are still unusable while mux_div[3:0] 0 because the 71m6531 adc writes to these locations. setting mux_div[3:0] = 0 disables the adc output preventing the ce from writing the first 0x40 bytes of ram.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 20 ? 2005 - 2010 teridian semiconductor corporation v1.3 the 80515 writes into external data memory when the mpu executes a movx @ri,a or movx @ dptr,a instruction. the mpu reads external data memory by executing a movx a,@ri or movx a,@dptr instruction (sfr pdata provides the upper 8 bytes for the movx a,@ri instruction). internal and external memory map table 7 shows the address, type, use and size of the various memory components. only the memory ranges shown in table 7 contain physical memory. table 7 : memory map address (hex) memory t echnology memory type name typical usage memory size (bytes) 00000 - 1ffff/ 00000 - 3ffff flash memory non - volatile program memory for mpu and ce mpu program and non- volatile data 128 kb/ 256 kb ? ce program (on 1 kb boundary) 8 kb max. 0000 - 0fff static ram volatile external ram (xram) shared by ce and mpu 4 kb 2000 - 20bf, 20c8 - 20ff static ram volatile configuration ram, i/o ram hardware control 256 20c0 - 20c7 static ram non - volatile (battery) configuration ram, i/o ram battery - buffered memory 8 0000 - 00ff static ram volatile internal ram part of 80515 core 256 ? memory size depends on the ic. see section 1.5.5 physical memory for details. movx addressing ther e are two types of instructions differing in whether they provide an 8 - bit or 16- bit indirect address to the external data ram. in the first type, movx a ,@ri , the contents of r0 or r1 in the current register bank provide the eight lower - ordered bits of address . the eight high - ordered bits of the address are specified with the pdata sfr . this method allows the user paged access (256 pages of 256 bytes each) to all ranges of the external data ram . in the second type of movx instruction , movx a,@dptr , the data pointer generates a 16 - bit address . this form is faster and more efficient when accessing very large data arrays (up to 64 kb ), since no additional instructions are needed to set up the eight high ordered bits of the address. it is possible to mix the two movx types . this provides the user with four separate data pointers, two with direct access and two with paged access , to the entire 64 kb of external memory range. dual data pointer the dual data pointer accelerates the block moves of data . the standa rd dptr is a 16 - bit register that is used to address external memory or peripherals . in the 80515 core, the standard data pointer is called dptr , the second data pointer is called dptr1 . the data pointer select bit , located in the lsb of the dps register ( dps [ 0 ] ), chooses the active pointer . dptr is selected when dps [ 0 ] = 0 and dptr1 is selected when dps [ 0 ] = 1. the user switches between pointers by toggling the lsb of the dps register . the values in the data pointers are not affected by the lsb of the dps register . all dptr related instructions use the currently selected dptr for any activity. the second data pointer may not be supported by certain compilers. dptr1 is useful for copy routines, where it can make the inner loop of the routine two inst ructions fast er compared to the reloading of dptr from registers . any interrupt routine using dptr1 must save and r estore dps , dptr and dptr1 , which increases stack usage and slows down interrupt latency. by selecting the evatronics r80515 core in the k eil compiler project settings and by using the compiler directive ? modc2?, dual data pointers are enabled in certain library routines.
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 21 an alternative data pointer is available in the form of the pdata register (sfr 0xbf ) , sometimes referred to as usr2 ) . it defines the high byte of a 16 - bit address when reading or writing xdata with the instruction movx a,@ri or movx @ri,a. internal data memory map and access the internal data memory provides 256 bytes (0x00 to 0xff) of data memory . the internal data me mory address is always 1 byte wide . table 8 shows the internal data memory map. the special function registers (sfr) occupy the upper 128 bytes . the sfr area of internal data memory is available only by direct addressing table 8 : internal data memory map . indirect addressing of this area accesses the upper 128 bytes of internal ram . the lower 128 bytes co ntain working registers and bit addressable memory . the lower 32 bytes form four banks of eight registers (r0 - r7) . two bits on the program memory status word ( psw ) select which bank is in use . the ne xt 16 bytes form a block of bit addressabl e memory space at bit addresses 0x00 - 0x7f . all of the bytes in the lower 128 bytes are accessible through direct or indirect addressing . address range direct addressing indirect addressing 0x80 0xff special function registers (sfrs) ram 0x30 0x7f byte addressable area 0x20 0x2f bit addressable area 0x00 0x1f register banks r0?r7 1.4.2 special fu nction registers (sfrs) a map of the special function registers is shown in table 9 . only a few addresses in the sfr memory space are occupied, the others are not im plemented. a read access to unimplemented addr esses will return undefined data, while a write access will have no effect. sfrs specific to the 71m6531 d / f and 71m6532d/f are shown in bold print on a gray field . the registers at 0x80, 0x88, 0x90, etc., are bit a ddressable, all others are byte addressa ble. see the restrictions for the intbits register in table 14 . table 9 : special function register map hex/ bin bit addressable byte addressable bin/ hex x000 x001 x010 x011 x100 x101 x11 0 x111 f8 intbits ff f0 b f7 e8 iflags ef e0 a e7 d8 wdcon df d0 psw d7 c8 t2con cf c0 ircon c7 b8 ien1 ip1 s0relh s1relh pdata bf b0 p3 flshctl fl_bank pgadr b7 a8 ien0 ip0 s0rell af a0 p2 dir2 dir0 a7 98 s0con s0buf ien2 s1con s1buf s1rell eedata eectrl 9f 90 p1 dir1 dps erase 97 88 tcon tmod tl0 tl1 th0 th1 ckcon 8f 80 p0 sp dpl dph dpl1 dph1 pcon 87
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 22 ? 2005 - 2010 teridian semiconductor corporation v1.3 1.4.3 generic 80515 special function registers table 10 shows the location, description and reset or power - up value of the generic 80515 sfrs . additional descriptions of the registers can be found at the page numbers listed in the table. table 10 : gene ric 80515 sfrs - location and reset values name address (hex) reset value (hex) description page p0 0x80 0xff port 0 24 sp 0x81 0x07 stack pointer 23 dpl 0x82 0x00 data pointer low 0 23 dph 0x83 0x00 data pointer high 0 23 dpl1 0x84 0x00 data pointer low 1 23 dph1 0x85 0x00 data pointer high 1 23 pcon 0x87 0x00 uart speed control , idle and stop mode control 28 tcon 0x88 0x00 timer/counter control 31 tmod 0x89 0x00 timer mode control 29 tl0 0x8a 0x00 timer 0, low byte 28 tl1 0x8b 0x00 timer 1, high byte 28 th0 0x8c 0x00 timer 0, low byte 28 th1 0x8d 0x00 timer 1, high byte 28 ckcon 0x8e 0x01 clock co ntrol (stretch=1) 24 p1 0x90 0xff port 1 23 dps 0x92 0x00 data pointer select register 20 s0con 0x98 0x00 serial port 0, control register 27 s0buf 0x99 0x00 serial port 0, data buffer 26 ien2 0x9a 0x00 interrupt enable register 2 31 s1con 0x9b 0x00 serial port 1, control register 27 s1buf 0x9c 0x00 serial port 1, data buffer 26 s1rell 0x9d 0x00 serial port 1, reload register, low byte 26 p2 0xa0 0xff port 2 23 ien0 0xa8 0x00 interrupt e nable register 0 30 ip0 0xa9 0x00 interrupt priority register 0 33 s0rell 0xaa 0xd9 serial port 0, reload register, low byte 26 p3 0xb0 0xff port 3 23 ien1 0xb8 0x00 interrupt enable register 1 31 ip1 0xb9 0x00 interrupt priority register 1 33 s0relh 0xba 0x03 serial port 0, reload register, high byte 26 s1relh 0xbb 0x03 serial port 1, reload register, high byte 26 pdata 0xbf 0x00 high address byte for movx@ri - also called usr2 20 ircon 0xc0 0x00 interrupt request control register 31 t2con 0xc8 0x00 polarity for int2 and int3 31 psw 0xd0 0x00 program status word 23 wdcon 0xd8 0x00 baud rate control register (only wdcon[ 7 ] bit used) 26 a 0xe0 0x00 accumulator 23 b 0xf0 0x00 b register 23
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 23 accumulator ( acc , a , sfr 0xe0 ): acc is the accumulator register . most instructions use the accumulator to hold the operand . the mne monics for accumulator - specific instructions refer to accumulator as a , not acc . b register ( sfr 0xf0 ) : the b register is used during multiply and divide instructions . it can also be used as a scratch - pad register to hold temporary data. program status word ( psw , sfr 0xd0 ): this register contains various flags and control bits for the selection of the register banks (see table 11 ). table 11 : psw bit functions ( sfr 0xd0 ) psw bit s ymbol function 7 cv carry flag . 6 ac auxiliary carry flag for bcd operations . 5 f0 general - purpose flag 0 available for user. f0 is not to be confused with the f0 flag in the cestatus register. 4 rs1 register bank select control bits . the contents o f rs1 and rs0 select the working register bank: rs1/rs0 bank selected location 00 bank 0 0x00 ? 0x07 01 bank 1 0x08 ? 0x0f 10 bank 2 0x10 ? 0x17 11 bank 3 0x18 ? 0x1f 3 rs0 2 ov overflow flag . 1 - user defined flag . 0 p parity flag, affecte d by hardware to indicate odd or even number of one bits in the accumulator, i.e. even parity. s tack pointer ( sp , sfr 0x81 ) : the stack pointer is a 1 - byte register initialized to 0x07 after reset . this register is incremented before push and call instructio ns, causing the stack to begin at location 0x08. data pointer: the data pointer s ( dptr and dprt1 ) are 2 bytes wide . the lower part is dpl (sfr 0x82) and dpl1 (sfr0x84) and the highest is dph (sfr0x83) and dph1 (sfr 0x85) . the data pointers can be loaded as two registers (e.g. mov dpl,#data8) . t hey are generally used to access external code or data space (e.g. movc a,@a+dptr or movx a,@dptr respectively). program counter: the program counter ( pc ) is 2 bytes wide and initialized to 0x0000 after reset . th e pc is incremented when fetching operation code or when operating on data from program memory . port registers: the i/o ports are controlled by special function registers p0 , p1 and p2 as shown in table 12 . the contents of the sfr can be observed on corresponding pins on the chip . writing a 1 to any of the ports causes the corresponding pin to be at high level (v3p3). writing a 0 causes the corresponding pin to be held at a low level (gnd) . the data direction registers dir0 , dir1 and dir2 define individual pins as input or output pins (see section s 1.5.7 digital i/o ? 71m6531d/f or 1.5.8 digital i/o ? 71m6532d/f ).
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 24 ? 2005 - 2010 teridian semiconductor corporation v1.3 table 12 : port registers register sfr address r/w description p0 0x80 r/w register for port 0 read and write operations . dir0 0xa2 r/w data direction re gister for port 0 . setting a bit to 1 indicates that the corresponding pin is an output. p1 0x90 r/w register for port 1 read and write operations . dir1 0x91 r/w data direction register for port 1. p2 0xa0 r/w register for port 2 read and write operati ons . dir2 0xa1 r/w data direction register for port 2. all dio ports on the chip are bi - directional . each of them consists of a latch (sfr p0 to p2 ), an output driver and an input buffer, therefore the mpu can output or read data through any of these p orts . even if a dio pin is configured as an output, the state of the pin can still be read by the mpu, for example when counting pulses issued via dio pins that are under ce control. the technique of reading the status of or generating interrupts based on dio pins configured as outputs can be used to implement pulse counting . clock stretching ( ckcon [2:0], sfr 0x8e ) the ckcon [2:0] field define s the stretch memory cycles that could b e used for movx instructions when access ing slow external peripherals. the practical value of this register for the 71m653x is to guarantee access to xram between ce, mpu, and spi . the default setting of ckcon [2:0] (001) should not be changed. table 13 shows how the signals of the ex ternal memory interface change when stretch values are set from 0 to 7. the widths of the signals are counted in mpu clock cycles. the post - reset state of the ckcon [2:0] field (001) , which is shown in bold in the table, performs the movx instructions wit h a stretch value equal to 1. table 13 : stretch memory cycle width ckcon[2:0] stretch value read signal width write signal width memaddr memrd memaddr memwr 000 0 1 1 2 1 001 1 2 2 3 1 010 2 3 3 4 2 011 3 4 4 5 3 100 4 5 5 6 4 101 5 6 6 7 5 110 6 7 7 8 6 111 7 8 8 9 7 1.4.4 special function registers (sfrs) specific to the 71m6531d/f and 71m6532d/f table 14 shows the location and description of the sfrs specific to the 71m6531 d / f and 71m6532d/f . table 14 : 71m6531d/f and 71m6532d/f specific sfrs register (alternate name) sfr add ress bit field name r/w description eedata 0x9e r/w i 2 c eeprom interface data register. eectrl 0x9f r/w i 2 c eeprom interface contro l register. see section 1.5.14 eeprom interface for a descrip tion of the command and status bits available for eectrl .
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 25 register (alternate name) sfr add ress bit field name r/w description erase (flsh_erase) 0x94 w this register is use d to initiate either the flash mass erase cycle or the flash page erase cycle. see the flash memory section for details. fl_bank 0xb6[2:0] r/w flash bank selection. pgaddr (flsh_pgadr [5:0] ) 0xb7 r/w flash page erase address register. contains the flash memory page address (page 0 through page 127) that will be erased during the page erase cycle (default = 0x00) . must be re - written for each new page erase cycle. flshcrl 0xb2[0] flsh_pwe r/w program write enable : 0: movx commands refer to xram space, normal operation (default). 1: movx @dptr,a moves a to program space (flash) @ dptr. 0xb2[1] flsh_meen w mass erase enable: 0: mass erase disabled (default). 1: mass erase enabled. must be re - written for each new mass erase cycle. 0xb2[6] secure r/w enables security provisions that prevent external reading of flash memory and ce program ram. this bit is reset on chip reset and may only be set. attempts to write zero are ignored. 0xb2[7] preboot r indicates th at the preboot sequence is active. iflags 0xe8[0] ie_xfer r/w this flag mo nitors the xfer_busy interrupt. it is set by hardware and must be cleared by the in terrupt handler. 0xe8[1] ie_rtc r/w this flag mo nitors the rtc_1sec inter rupt. it is set b y the hardware and must be cleared by the in terrupt handler. 0xe8[2] fwcol 1 r/w this flag indicates that a flash write was in progress while the ce was busy. 0xe8[3] fwcol 0 r/w this flag indicates that a flash write was attempted when the ce was atte mpting to be gin a code pass. 0xe8[4] ie_pb r/w this flag indicates that the wake - up pushbutton was pressed. 0xe8[5] ie_wake r/w this flag indicates that the mpu was awakened by the autowake timer. 0xe8[6] pll_rise r/w pll_rise interrupt flag: write 0 to c lear the pll_rise interrupt flag . 0xe8[7] pll_fall r/w pll_fall interrupt flag: write 0 to c lear the pll_fall interrupt flag . intbits ( int0 ? int6 ) 0xf8[6:0] int6 ? int0 r interrupt inputs. the mpu may read these bits to see the status of external interrupts int0 up to int6 . these bits do not have any memory and are primarily intended for debug use. 0xf8[7] wd_rst w the wdt is reset when a 1 is written to this bit. only byte operations on the entire intbits register should be used when writin g. the byte must have all bits set except the bits that are to be cleared.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 26 ? 2005 - 2010 teridian semiconductor corporation v1.3 1.4.5 instruction set all instructions of the generic 8051 microcontroller are supported . a complete list of the instruction set and of the associated op - codes is contained in the 71m 653x software user?s guide (sug) . 1.4.6 uarts the 71m6531 d / f and 71m6532d/f include a uart (uart0) that can be programmed to communicate with a variety of amr modules . a second uart (uart1) is connected to the optical port, as described in section 1.5.6 optical interface . the uarts are dedicated 2 - wire serial interfaces, which can communicate with an extern al host pro cessor at up to 38,400 bits/s (with mpu clock = 1.2288 mhz) . the operation of the rx and tx uart0 pins is as follows: ? uart0 rx: serial input data are applied at this pin . conforming to rs - 232 standard, the bytes are input lsb first. ? uart0 tx : this pin is used to output the serial data . the bytes are output lsb first. the 71m6531 d / f and 71m6532d/f ha ve several uart - related registers for the control and buffering of serial data . a single sfr register serves as both the transmit buffer and receive buffer ( s0buf, sfr 0x99 for uart0 and s1buf, sfr 0x9c for uar t1). when written by the mpu, s0buf and s1 buf act as transmit buffer s for their respective channels , and when read by the mpu, t hey act as receive buffer s . writing data to the transmit buffer starts the transmission by the associated uart. received data are available by reading from the receive buffer. both uarts can simultaneously transmit and receive data. wdcon [7] ( sfr 0xd8 ) selects whether timer 1 or the internal baud rate generator is used . all uart transfers are pro grammable for parity enable, par ity, 2 stop bits/1 stop bit and xon/xoff options for variable communication baud rates from 300 to 38400 bps . table 15 shows how the baud rates are calculated . table 16 s hows the selectable uart operation modes. table 15 : baud rate generation using timer 1 ( wdcon [7] = 0) using internal baud rate generator ( wdcon [7] = 1) uart0 2 smod * f ckmpu / (384 * (256 - th1 )) 2 smod * f ckmpu /(64 * (2 10 - s0rel )) u art1 n/a f ckmpu /(32 * (2 10 - s1rel )) s0rel and s1rel are 10 - bit values derived by combining bits from the respective timer reload registers ( s0rell, s0relh, s1rell, s1relh ) . smod is the smod bit in the sfr pcon register . th1 is the high byte of timer 1. t able 16 : uart modes uart 0 uart 1 mode 0 n/a start bit, 8 data bits, parity, stop bit, variable baud rate (internal baud rate generator) mode 1 start bit, 8 data bits, stop bit, variable baud rate (internal baud rate generator or timer 1) start bit, 8 data bits, stop bit, variable baud rate (internal baud rate generator) mode 2 start bit, 8 data bits, parity, stop bit, fixed baud rate 1/32 or 1/64 of f ckmpu n/a mode 3 start bit, 8 data bits, parity, stop bit, v a- riable baud rate (internal baud rate g e- nerator or timer 1) n/a parity of serial data is available through the p flag of the accumulator . 7 - bit serial modes with parity, such as those used by the flag protocol, can be simulated by setting and reading bit 7 of 8 - bit outp ut data . 7 - bit serial modes without parity can be simulated by setting bit 7 to a constant 1 . 8 - bit serial modes with parity can be simulated by setting and reading the 9 th bit, using the control bits tb80 ( s0con [ 3 ] ) and tb81 ( s1con [3] ) in the s0co n ( sfr 0x98 ) and s1con ( sfr 0x9b) sfrs for transmit and rb81 ( s1con [2] ) for receive operations .
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 27 the feature of receiving 9 bits (mode 3 for uart0, mode a for uart1) can be used as handshake signals for inter - processor communication in multi - processor systems. in this case, the slave processors have bit sm20 ( s0con[5] ) for uart0, or sm21 ( s1con[5] for uart1, set to 1. when the master pro cessor outputs the slave?s address, it sets the 9 th bit to 1, causing a serial port receive interrupt in all the slaves. th e slave processors compare the received byte with their address. if there is a match, the addressed slave will clear sm20 or sm21 and receive the rest of the message. all other slave s will ignore the message. after addressing the slave, the host outputs the rest of the message with the 9 th bit set to 0, so no additional serial port receive interrupts will be generated. uart control registers: the function s of uart0 and uart1 depend on the setting of the serial port control register s s0con and s1con shown in table 17 and table 18, respectively and the pcon register shown in table 19. since the ti0, ri0, ti1 and ri1 bits are in an s fr bit addressable byte, common practice would be to clear them with a bit operation, but this must be avoided the proper way to clear these flag bits is to write a byte mask consisting of all ones except for a zero in the location of the bit to be cleared. the flag bits are configured in hardware to ignore ones wri tten to them. . the hardware implements bit operations as a byte wide read - modify - write hardware macro. if an interrupt occurs after the read, but before the write, its flag will be cleared unintentionally. table 17 : the s0con (uart0) register (sfr 0x98) bit symbol function s0con [7] sm0 the sm0 and sm1 bits set the uart0 mode: mode description sm0 sm1 0 n/a 0 0 1 8 - bit uart 0 1 2 9 - bit uart 1 0 3 9 - bit uart 1 1 s0con [6] sm1 s0con [5] sm20 enables the inter - processor communication feature. s0con [4] ren0 if set, enables serial reception . cleared by software to disable reception. s0con[3] tb80 the 9th transmitted data bit in modes 2 and 3. set or cleared by the mpu, depending on the function it performs (parity check, multiprocessor communication etc.) s0con[2] rb80 in modes 2 and 3 it is the 9 th data bit received. in mode 1, sm20 is 0, rb80 is the stop bit. in mode 0, this bit is not used. must be cleared b y software. s0con[1] ti0 transmit interrupt flag; set by hardware after completion of a serial transfer. must be cleared by software. s0con[0] ri0 receive interrupt flag; set by hardware after completion of a serial reception. must be cleared by softwa re. table 18 : the s1con (uart1) register (sfr 0x9b) bit symbol function s1con [7] sm sets the baud rate and mode for uart1. sm mode description baud rate 0 a 9 - bit uart variable 1 b 8 - bit uart variable s1con [5] sm21 enables t he inter - processor communication feature. s1con [4] ren1 if set, enables serial reception . cleared by software to disable reception. s1con [3] tb81 the 9 th transmitted data bit in mode a . set or cleared by the mpu, depending on the function it performs ( parity check, multiprocessor communication etc.)
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 28 ? 2005 - 2010 teridian semiconductor corporation v1.3 bit symbol function s1con [2] rb81 in modes a and b, it is the 9 th data bit received . in mode b, if sm21 is 0, rb81 is the stop bit . must be cleared by software s1con [1] ti1 transmit interrupt flag, set by hardware after com pletion of a serial transfer . must be cleared by software. s1con [0] ri1 receive interrupt flag, set by hardware after completion of a serial reception . must be cleared by software . table 19 : pcon register bit description (sfr 0 x87) bit symbol function pcon[7] smod the smod bit doubles the baud rate when set pcon[6:2 ] ? not used. pcon[1 ] stop stops mpu flash access and mpu peripherals including timers and uarts when set until an external interrupt is received. pcon[0 ] idle s tops mpu flash access when set until an internal interrupt is received. 1.4.7 timers and counters the 80515 has two 16 - bit timer/counter registers: timer 0 and timer 1 . these registers can be con figured for counter or timer operations. in timer mode, the r egister is incremented every 12 mpu clock cycle s. in counter mode, the register is incremented when the falling edge is observed at the corresponding input signal t0 or t1 (t0 and t1 are the timer gating inputs derived from certain dio pins, see section 1.5.7 digital i/o ) . since it takes 2 machine cycles to recognize a 1 - to - 0 event, the maximum input count rate is 1/2 of the clock frequency (ckmpu). there are no restri ctions on the duty cycle, however to ensure proper recognition of the 0 or 1 state, an input should be stable for at least 1 machine cycle. four operating modes can be selected for timer 0 and timer 1 , as shown in t able 20 and table 21 . the tmod register, shown in table 22, is used to select the appropriate mode. the timer/counter operation is controlled by the tcon register, which is shown in table 23 . bits tr1 ( tcon [6] ) and tr0 ( tcon [4] ) in the tcon register start their associated timers when set. table 20 : timers/counters mode description m1 m0 mode function 0 0 mode 0 13 - bit counter/timer mode with 5 lower bits in the tl0 or tl1 register and the remaining 8 bits in the th0 or th1 register (for timer 0 and timer 1, respectively) . the 3 high order bits of tl0 and tl1 are held at zero. 0 1 mode 1 16- bit counter/t imer mode . 1 0 mode 2 8 - bit auto - reload counter/timer . the reload value is kept in th0 or th1 , while tl0 or tl1 is incremented every machine cycle . when tl( x) overflows, a value from th( x) is copied to tl (x) (where x = 0 for coun ter/timer 0 or 1 for cou nter/timer 1 . 1 1 mode 3 if timer 1 m1 and m0 bits are set to 1, timer 1 stops. if timer 0 m1 and m0 bits are set to 1, timer 0 acts as two independent 8 - bit timer/counters. in mode 3, tl0 is affected by tr0 and gate control bits and sets the tf0 fla g on overflow, while th0 is affected by the tr1 bit and the tf1 flag is set on overflow. table 21 specifies the combinations of operation modes allowed for timer 0 and timer 1.
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 29 table 21 : a llowed timer /counter mode combinations timer 1 mode 0 mode 1 mode 2 timer 0 - mode 0 yes yes yes timer 0 - mode 1 yes yes yes timer 0 - mode 2 not allowed not allowed yes table 22 : tmod register bit description (sfr 0x89) bi t symbol function timer/counter 1 : tmod[7] gate if tmod[7] is set, external input signal control is enabled for counter 0. external gate control . the tr 1 bit in the tcon register (sfr 0x88) must al so be set in order for counter 1 to increment. w ith th ese settings c ounter 1 is incremented on every falling edge o f the logic signal applied to one or more of the i n terrupt sources controlled by the di_rbp , dio_r1 , ? dio_rxx registers. tmod[6] c/t selects timer or counter operation. when set to 1, a count er operation is per formed. when cleared to 0, the corresponding register will function as a timer. tmod[5:4] m1:m0 selects the mode for ti mer/counter 1 as shown in table 20. timer/counter 0: tmod[3] gate if tmo d[3 ] is set, external input signal control is enabled for counter 0. external gate control . the tr0 bit in the tcon register (sfr 0x88) must also be set in order for counter 0 to increment. w ith these settings c ounter 0 is incremented on every falling e dge o f the logic signal applied to one or more of the i n terrupt sources controlled by the di_rbp , dio_r1 , ? dio_rxx registers. tmod[2] c/t selects timer or c ounter operation. when set to 1, a c ounter operation is performed. when cleared to 0, the corres pondi ng register will function as a t imer. tmod[1:0] m1:m0 selects the mode for t imer/counter 0 , as shown in table 20. table 23 : the tcon register bit functions (sfr 0x88) bit symbol func tion tcon[7] tf1 the timer 1 overflow flag is set by hardware when timer 1 overflows. this flag can be cleared by software and is automatically cleared when an interrupt is processed. tcon[6] tr1 timer 1 run control bit. if cleared, timer 1 stops. tco n[5] tf0 timer 0 overflow flag set by hardware when timer 0 overflows. this flag can be cleared by software and is automatically cleared when an interrupt is processed. tcon[4] tr0 timer 0 run control bit. if cleared, timer 0 stops. tcon[3] ie1 interru pt 1 edge flag is set by hardware when the falling edge on external pin int1 is observed. cleared when an interrupt is processed. tcon[2] it1 interrupt 1 type control bit. selects either the falling edge or low level on input pin to cause an interrupt. tcon[1] ie0 interrupt 0 edge flag is set by hardware when the falling edge on external pin int0 is observed. cleared when an interrupt is processed. tcon[0] it0 interrupt 0 type control bit. selects either the falling edge or low level on input pin to cause interrupt.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 30 ? 2005 - 2010 teridian semiconductor corporation v1.3 1.4.8 wd timer (software watchdog timer) the re is no internal software watchdog timer. use the standard watchdog timer instead (see 1.5.16 hardware watchdog timer ). 1.4.9 interrupts the 80515 mpu provides 11 interrupt sources with four priority levels . each source has its own request flag(s) located in a special function register ( tcon , ircon and scon ) . each interrupt requested by the corresponding flag can be i ndividually enabled or disabled by the enable bits in sfrs ien0 (sfr 0xa8), ien1 (sfr 0xb8) , and ien2 (sfr 0x9a ) . figure 8 shows the device interrupt structure. referring to figure 8 , interrupt sources can originate from within the 80515 mpu core (referred to as in ternal sources) or can originate from other parts of the 71m65 3 x soc (referred to as external sources). there are seven external interrupt sources, as seen in th e leftmost part of figure 8 , and in table 24 and table 25 (i.e., ex0 - ex6 ). i nterrupt overview when an interrupt occurs, the mpu w ill vector to the predetermined address as shown in table 36 . once the interrupt service has begun, it can be interrupted only by a higher priority interrupt . the interrupt service is terminated by a return from instruction, reti . when an reti is performed, the processor will return to the instruction that would have been next when the interrupt occurred. when the interrupt condition occurs, the processor will also indicate this by setting a flag bit . this bit i s set regardless of whether the interrupt is enabled or disabled . each interrupt flag is sampled once per machine cycle, after that, samples are polled by the hardware . if the sample indicates a pending interrupt when the interrupt is enabled, then the i nterrupt request flag is set . on the next instruction cycle, the interrupt will be acknowledged by hardware forcing an lcall to the appropriate vector address, if the following conditions are met: ? no interrupt of equal or higher priority is already in pro gress. ? an instruction is currently being executed and is not completed. ? the instruction in progress is not reti or any write access to the registers ien0 , ien1 , ien2 , ip0 or ip1 . special function registers for interrupts the following sfr registers contro l the interrupt functions: ? the interrupt enable registers: ien0 , ien1 and ien2 (see table 24 , table 25 an d table 26 . ? the timer/cou nter control registers, tcon and t2con (see table 27 and table 28 ). ? the interrupt request r egister , ircon (see table 29 ). ? the inte rrupt priority registers: ip0 and ip1 (see table 34 ). table 24 : the ien0 bit functions (sfr 0xa8) bit symbol function ien0 [7] eal eal = 0 disable s all interrupts . ien0 [6] wdt not used f or interrupt control . ien0 [5] ? not used. ien0 [4] es0 es0 = 0 disable s serial channel 0 interrupt . ien0 [3] et1 et1 = 0 disable s timer 1 overflow interrupt . ien0 [2] ex1 ex1 = 0 disable s external interrupt 1 . ien0 [1] et0 et0 = 0 disable s timer 0 overflo w interrupt . ien0 [0] ex0 ex0 = 0 disable s external interrupt 0 .
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 31 table 25 : the ien1 bit functions (sfr 0xb8) bit symbol function ien1[7] ? not used. ien1[6] ? not used. ien1 [5] ex6 ex6 = 0 disable s external interrupt 6 : xfer_bu sy, rtc_1sec, wd_nrovf ien1 [4] ex5 ex5 = 0 disable s external interrupt 5 : eeprom_busy ien1 [3] ex4 ex4 = 0 disable s external interrupt 4 : pll_ok (rise), pll_ok (fall) ien1 [2] ex3 ex3 = 0 disable s external interrupt 3 : ce_busy ien1 [1] ex2 ex2 = 0 disable s external interrupt 2 : fwcol0, fwcol1, spi ien1 [0] ? not used. table 26 : the ien2 bit functions (sfr 0x9a) bit symbol function ien2[0] es1 es1 = 0 disable s the serial channel 1 interrupt . table 27 : tco n bit functions (sfr 0x88) bit symbol function tcon[7] tf1 timer 1 overflow flag . tcon [6] tr1 not used for interrupt control . t con[5] tf0 timer 0 overflow flag . tcon[4] tr0 not used for interrupt control . tcon[3] ie1 external interrupt 1 flag . tcon[2 ] it1 external interrupt 1 type control bit : 0 = interrupt on low level . 1 = interrupt on falling edge . tcon[1] ie0 external interrupt 0 flag tcon[0] it0 external interrupt 0 type control bit : 0 = interrupt on low level . 1 = interrupt on falling edge . table 28 : the t2con b it functions (sfr 0xc8) bit symbo l function t2con[7] ? not used . t2con[6] i3fr polarity control for external interrupt 3: ce_busy 0 = falling edge . 1 = rising edge . t2con[5] i2fr polarity control for external interrupt 2: fwcol0, fwcol1 , spi 0 = falling edge. 1 = rising edge. t2con[4:0] ? not used . table 29 : the ircon bit functions (sfr 0xc0) bit symbol function ircon[7] ? not used ircon[6] ? not used ircon[5] iex6 1 = external interrupt 6 occurred and has not been cleared. irco n[4] iex5 1 = external interrupt 5 occurred and has not been cleared. ircon[3] iex4 1 = external interrupt 4 occurred and has not been cleared. ircon[2] iex3 1 = external interrupt 3 occurred and has no t been cleared.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 32 ? 2005 - 2010 teridian semiconductor corporation v1.3 ircon[1] iex2 1 = external interrupt 2 occurred and has not been cleared. ircon[0] ? not used . tf0 and tf1 (timer 0 and t imer 1 overflow flag s ) will be automatically cleared by hardware when the service routine is called (signals t0ack and t1ack ? port isr ? active high when the service routine is called). external mpu interrupts the seven e xternal interrupts are the interrupts external to the 80515 core, i.e. signals that originate in other parts of the 71m6531 d / f or 71m6532d/f , for ex ample the ce, dio, rtc or eeprom interface. the external interrupts are connected as described in table 30 . the po larity of interrupts 2 and 3 is pro grammable in the mpu via the i3fr and i2fr bits in t2con (sfr 0 xc8) . interrupts 2 and 3 should be programmed for falling sensitivity ( i3fr = i2fr = 0). the generic 8051 mpu literature states that interrupts 4 through 6 are defined as rising - edge sensitive. thus, the hardware signals attached to interrupts 5 and 6 a re inverted to achieve the edge polarity shown in table 30. table 30 : external mpu interrupts external interrupt connection polarity flag reset 0 digital i/o high priority see section 1.5.7 automatic 1 digital i/o low priority see section 1.5.7 automatic 2 fwcol0, fwcol1 , spi falling automatic 3 ce_busy falling automatic 4 pll_ok (rising), pll_ok (falling) rising automatic 5 eeprom busy falling automatic 6 xfer_busy, rtc_1sec or wd_nr ovf falling manual external interrupt 0 and 1 can be mapped to pins on the device using dio resource maps. see section 1.5.7 digital i/o for more information. fwcolx interrupts occur when the ce collides with a flash write attempt . see the f lash w rite description in the flash memory sect ion for more detail. sfr enable bits must be set to permit any of these interrupts to occur . likewise, each interrupt has its own flag bit, which is set by the interrupt hardware, and reset by the mpu interrupt handler . xfer_busy, rtc_1sec, wd_nrovf, fwc ol0, fwcol1, spi, pllrise and pllfall have their own enable and flag bits in addition to the interrupt 6 , 4 and enable and flag bits (see table 31 ) . ie0 through iex6 are cleared automatically when the hardware vect ors to the interrupt handler . the other flags, ie_xfer through ie_pb, are cleared by writing a zero to them . since these bits are in an sfr bit addressable byte, common practice would be to clear them with a bit operation, but this must be avoided the proper way to clear the flag bits is to write a byte mask c onsisting of all ones except for a zero in the location of the bit to be cleared . the flag bits are configured in hardware to ignore ones written to them. . th e hardware impl ements bit operations as a byte - wide read - modify - write hardware macro . if an interrupt occurs after the read, but before the write, its flag will be cleared un intentionally . table 31 : interrupt enable and flag bits interrupt enable interrupt flag int errupt description n ame location n ame location ex0 sfr a8[0] ie0 sfr 88[1] external interrupt 0 ex1 sfr a8[2] ie1 sfr 88[3] external interrupt 1 ex2 sfr b8[1] iex2 sfr c0[1] external interrupt 2 ex3 sfr b8[2] iex3 sfr c0[2] external interrupt 3
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 33 interrupt enable interrupt flag int errupt description n ame location n ame location ex4 sfr b8[3] iex4 sfr c0[3] external interrupt 4 ex5 sfr b8[4] iex5 sfr c0[4] external interrupt 5 ex6 sfr b8[5] iex6 sfr c0[5] external interrupt 6 ex_xfer 2002[0] ie_xfer sfr e8[0] xfer_busy interrupt (int 6) ex_rtc 2002[1] ie_rtc sfr e8[1] rtc_1sec int errupt (int 6) ien_wd_nrovf 20b0[0] wd_nrovf_flag 20b1[0] wdt near overflow (int 6) ien_spi 20b0[4] spi_flag 20b1[4] spi interface (int2) ex_fwcol 2007[4] ie_fwcol0 sfr e8[3] fwcol0 interrupt (int 2) ie_fwcol1 sfr e8[2] fwcol1 interrupt (int 2) ex_p ll 2007[5] ie_pllrise sfr e8[6] pll_ok rise interrupt (int 4) ie_pllfall sfr e8[7] pll_ok fall interrupt (int 4) ie_wake sfr e8[5] autowake flag ? ie_pb sfr e8[4] pb flag ? ? the autowake and pb flag bits are shown in table 31 because they behave similarly to interrupt flags, even though they are not actually related to an interrupt . these bits are set by hardware when the mpu wakes from a push button or wake timeout . the bits are reset by writing a zero . note that the pb flag is set whenever the pb is pushed, even if the part is already awake. interrupt priority level structure all interrupt sources are combined in groups, as shown in table 32: table 32 : interrupt priority level groups group group members 0 external interrupt 0, serial channel 1 interrupt 1 timer 0 interrupt, external interrupt 2 2 external interrupt 1, external interrupt 3 3 timer 1 interrupt, external interrupt 4 4 serial channel 0 interrupt, external interrupt 5 5 external interrupt 6 each group of interrupt sources can be programmed individually to one of four priority levels (as shown in table 33 ) by setting or cleari ng one bit in the sfr interrupt priority register ip0 and one in ip1 ( table 34) . if requests of the same priority level are received simultaneously, an internal polling sequence as shown in table 35 determines which request is serviced first. changing interrupt priorities while interrupts are enabled can easily cause software defects. it is best to set the interrupt priority registers only once during initialization befo re interrupts are enabled. table 33 : interrupt priority levels ip1 [ x ] ip0 [ x ] priority level 0 0 level 0 (lowest) 0 1 level 1 1 0 level 2 1 1 level 3 (highest)
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 34 ? 2005 - 2010 teridian semiconductor corporation v1.3 table 34 : interrupt priority registers ( ip0 and ip1 ) register address bit 7 (msb) bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 (lsb) ip0 sfr 0xa9 ? ? ip0[5] ip0[4] ip0[3] ip0[2] ip0[1] ip0[0] ip1 sfr 0xb9 ? ? ip1[5] ip1[4] ip1[3] ip1[2] ip1[1] ip1[0] table 35 : interrupt p olling sequence external interrupt 0 polling sequence serial channel 1 interrupt timer 0 interrupt external interrupt 2 external interrupt 1 external interrupt 3 timer 1 interrupt external interrupt 4 serial channel 0 interrupt external in terrupt 5 external interrupt 6 interrupt sources and vectors table 36 shows the interrupts with their associated flags and vector addresses. table 36 : interrupt vectors interrupt requ est flag description interrupt vector address ie0 external interrupt 0 0x0003 tf0 timer 0 interrupt 0x000b ie1 external interrupt 1 0x0013 tf1 timer 1 interrupt 0x001b ri0/ti0 serial channel 0 interrupt 0x0023 ri1/ti1 serial channel 1 interrupt 0x008 3 iex2 external interrupt 2 0x004b iex3 external interrupt 3 0x0053 iex4 external interrupt 4 0x005b iex5 external interrupt 5 0x0063 iex6 external interrupt 6 0x006b
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teridian semiconductor corporation 35 figure 8 : interrupt structure tcon. 1 ( ie 0 ) individual enable bits s 1 con. 0 ( ri 1 ) s 1 con. 1 ( ti1 ) individual flags internal source > = 1 tcon. 5 ( tf 0 ) tcon. 3 ( ie 1 ) tcon. 7 ( tf 1 ) s 0 con. 0 ( ri 0 ) s 0 con. 0 ( ti0 ) > = 1 ircon . 1 ( iex 2 ) i 2 fr ircon . 2 ( iex 3 ) i 3 fr ircon . 3 ( iex 4 ) ircon . 4 ( iex 5 ) ircon . 5 ( iex 6 ) ien0 . 7 ( eal) ip1 . 0 / ip0 . 0 ip1 . 1 / ip0 . 1 ip1 . 2 / ip0 . 2 ip1 . 3 / ip0 . 3 ip1 . 4 / ip0 . 4 ip1 . 5 / ip0 . 5 interrupt flags priority assignment interrupt vector polling sequence interrupt enable logic and polarity selection dio timer 0 timer 1 ce_busy uart0 eeprom xfer _ busy rtc_1s ex_rtc pll ok external source dio_ rn dio_ rn i2c > = 1 flash write collision > = 1 ien2 . 0 ( es1 ) ien0 . 1 ( et0 ) ien0 . 0 ( ex0 ) ien1 . 1 ( ex2 ) ien0 . 2 ( ex1 ) ien1 . 2 ( ex3 ) ien0 . 3 ( et1 ) ien1 . 3 ( ex4 ) ien0 . 4 ( es0 ) ien1 . 4 ( ex5 ) ien1 . 5 ( ex6 ) ie_xfer ie_rtc ex_xfer > = 1 ex_eex ex_spi ie_eex ie_spi it 0 ie_fwcol1 spi_flag uart1 ( optical) 0 2 1 3 4 5 6 no. flag= 1 means that an inter- rupt has oc- curred and has not been cleared ex0 ? ex6 are cleared automatically when the hardware vectors to the interrupt handler byte received byte transmitted overflow occurred overflow occurred byte received byte transmitted accumulation cycle completed pll status changed ce completed code run and has new status information dio status changed dio status changed every second busy fell command received spi i/ f write attempt, ce busy 2 / 2 / 2009 ie_fwcol0 dio nr_ovf ex_fwcol ex_pll ie_pllrise ie_pllfall ien_spi ien_nr_ wdovf wd_nrovf_flag ce code start, flash write busy wdt near overflow > = 1 mpu- external sources mpu- internal sources
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 36 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 1.5 on - chip resources 1.5.1 osc illator the oscillator of the 71m6531 d / f and 71m6532d/f drives a standard 32.768 khz watch crystal . these crystals are accurate and do not require a high - current oscillator circuit . the oscillator of the 71m6531d/f and 71m6532d/f has been designed specif ically to handle these crystals and is compatible with their high impedance and li mited power handling capability. oscillator calibration can improve the accuracy of both the rtc and metering. refer to section 1.5.3 real - time clock (rtc) for more information. the oscillator is powered directly and only from vbat, which therefore must be connected to a dc vol tage source. the oscillator requires approximately 100 na, wh ich is negligible compared to the internal leakage of a battery . the oscillator may appear to work when vbat is not connected, b ut t his mode of operation is not re commended. if vbat is connected to a drained battery or disconnected, a battery test th at sets bme may drain vbat?s supply and cause the oscillator to stop. a stopped oscillator may force the device to reset. therefore, an unexpected reset during a battery test should be interpreted as a battery failure. 1.5.2 internal clocks timing for the dev ice is derived from the 32.768 khz crystal oscillator output . on - chip timing functions include : ? t he mpu clock (ckmpu) ? t he emulator clock (2 x ckmpu) ? t he clock for the ce (ckce) ? t he clock driving the delta - sigma adc along with the fir (ckadc, ckfi r) ? a real time clock (rtc). the two general - purpose counter/timers contained in the mpu are controlled by ckmpu (see section 1.4.7 timers and counters ) . table 37 provides a summary of the available clock functions . table 37 : clock system summary clock derived from mck divider / [ m40mhz, m26mhz ] brownout mode 2 / [1,0] 3 / [0,1] 4 ** / [0,0] ckpll crystal 78.6432 mhz 78.6432 mhz 78.6432 mhz off mck ckpll 39.3216 mhz 26.2144 mhz 19.6608 mhz 112 khz ckce mck 4.9152 mhz ? 9.8304 mhz ? 6.5536 mhz 4.9152 mhz off ckadc / ckfir mck 4.9152 mhz 6.5536 mhz 4.9152 mhz 28 khz ckmpu maximum mck 9.8304 mhz *** 6.5 536 mhz *** 4.9152 mhz *** 28 khz ck32 mck 32 .768 khz 32 .768 khz 32 .768 khz ** default state at power - up *** the maximum ckmpu frequency . ckmpu can be reduced from this rate using mpu_div[2:0] . ? ckce = 9.8304 mhz when ce1 0mhz is set, 4.9152 mhz othe rwise. the master clock, mck, is generated by an on - chip pll that multiplies the oscillator output frequency (ck32) by 2400 to provide approximately 80 mhz ( 78. 6432 mhz ). a divider controlled by the i/o ram bits m40mhz and m26mhz permits scaling of mck by ?, ? and ?. all other clocks are derived from this scaled mck output (making them multiples of 32768 hz), and the clock skew is matched so that the rising edges of ckadc, ckce, ck32 and ckmpu are aligned.
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 37 the pll generate s a 2x emulator clock which i s controlled by the eck_dis bit . since clock noise from this feature may disturb the adc, it is recommended that this option be avoided when possible. the mpu clock frequency ckmpu is determined by another divider controlled by the i/o ram field mpu_div[2 :0] and can be set to mck/2 ( mpu_div +2) hz where mpu_div[2:0] varies from 0 to 6. the circuit also generates the 2 x ckmpu clock for use by the emulator. the emulator clock is not generated when eck_dis is asserted. during a power - on reset, [ m40mhz, m26mh z ] defaults to [0, 0] and the mck divider is set to divide by 4. when [ m40mhz , m26mhz ] = [1, 0], the ce clock frequency may be set to ~ 5 mhz ( 4.9152 mhz) or ~ 10 mhz ( 9.8304 mhz) , using the i/o ram register ce10mhz . in this mode, the adc and fir clock frequ e n- cies remain at ~ 5 mhz. when [ m40mhz , m26mhz ] = [ 0,1 ] , the ce, adc, fir and mpu clock freque n- cies are shifted to ~ 6.6 mhz ( 6.5536 mhz ) . this increases the adc sample rate by 33%. ce codes are tailored to particular clock frequencies. changing the c lock frequency for a par ticular ce code may render it unusable. in sleep mode, the m40mhz and m26mhz inputs to the clock generator are forced low. in brownout mode, the clocks are derived from the crystal oscillator and the clock frequencies are scaled by 7/8. 1.5.3 real - time clock (rtc) the rtc is driven directly by the crystal oscillator . it is powered by the net rtc_nv (battery - backed up supply) . the rtc consists of a counter chain and output registers . the counter chain consists of registers for second s, minutes, hours, day of week, day of month, month and year . the rtc is capable of processing leap years . each counter has its own output register . whenever the mpu reads the seconds register, all other output registers are automatically updated . sinc e the rtc clock (rtclk) is not coherent to the mpu clock, the mpu must read the seconds register until two consecutive reads are the same (this requires either 2 or 3 reads) . at this point, all rtc output registers will have the correct time . regardless of the mpu clock speed, rtc reads require one wait state. rtc time is set by writing to the registers rtc_sec [5:0] through rtc_yr . each write operation must be preceded by a write operation to the we register in i/o ram. the value written to the we regis ter is un im portant. time adjustments are written to the rtca_adj [6:0] , preg [16:0] and qreg[1:0] registers . updates to preg[16:0] and qreg[1:0] must occur after the one second interrupt and must be finished before reaching the next one second boundary . the new values are loaded into the counters at the next one second boundary. preg[16:0] and qreg[1:0] are separate registers in the device hardware, but the bits are 16- bit contiguous so the mpu firmware can treat them as a single register. a single binar y number can be calculated and then loaded into them at the same time. the 71m 6531 d / f and 71m6532d/f ha ve two rate adjustment mechanisms . the first is an analog rate adjustment, using rtca_adj[6:0], which trims the crystal load capacitance . setting rtca_ adj[6:0] to 00 minimizes the load capacitance, maximizing the oscillator frequency . setting rtca_adj[6:0] to 0x 3 f maximizes the load capacitance, minimizing the oscillator frequency . the adjustable capacitance is ap proximately: pf adj rtca c adj 5 . 16 128 _ ? = the maximum adjustment range is approximately - 12 ppm to +22ppm . the precise amount of adjustment will depend on the crystal properties . the adjustment may occur at any time and the resulting clock fre quency can be measured over a one - second interval . the se cond rate adjustment is a digital rate adjust using preg[16:0] and qreg[1:0] , which can be used to adjust the clock rate up to 988 ppm, with a resolution of 3.8 ppm . updates must occur after a one second interrupt and must finish before the next one sec ond boundary . the rate adjustment will be im plemented starting at the next one second boundary . since the lsb results in an adjustment every four seconds, the frequency should be measured over an interval that is a multiple of four seconds .
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 38 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 to adjust the clock rate using the digital rate adjust, the appropriate values must be written to preg[16:0] and qreg[1:0] . the default frequency is 32,768 rtclk cycles per second . to shift the clock frequency by ? ppm, calculate preg[16:0] and qreg[1:0] using the fo llowing equation: ? ? ? ? ? ? + ? ? + ? = + ? ? 5 . 0 10 1 8 32768 4 6 floor qreg preg for example, for a shift of - 988 ppm, 4 ? preg + qreg = 262403 = 0x40103 . preg[16:0] = 0x10040 and qreg[1:0] = 0x03 . the default values of preg[16:0] and qreg[1:0] , corresponding to zero adjustment, are 0x10000 an d 0x0, respectively . the rtc timing may be observed on the tmuxout pin by setting tmux[4:0] to 0x10 or 0x11. default values for rtc a _adj , preg[16:0] and qreg[1:0] should be nominal values, at the center of the ad justment range. e xtreme values (zero for e xample) can cause incorrect operation. if the crystal temperature coefficient is known, the mpu can integrate temperature and correct the rtc time as necessary. the sub - second register of the rtc, subsec , can be read by the mpu after the one second interru pt and before reaching the next one second boundary . subsec contains the count remaining, in 1/256 second nominal clock periods, until the next one second boundary . when the rst_subsec bit is written, the subsec counter is restarted . reading and resetti ng the sub - second counter can be used as part of an algorithm to accurately set the rtc. when se tting the rtc_sec register , it is important to take into account that the associated write operation w ill be performed o nly in the next second bo u ndary. 1.5.4 tempe rature sensor the device includes an on - chip temperature sensor for determining the temperature of the bandgap re ference . if automatic temperature measurement is not performed by selecting chop_e[1:0] = 00, t he mpu may request an alternate multiplexer fr ame containing the temperature sensor output by asserting mux_alt . the primary use of the temperature data is to determine the magnitude of compensation re quired to offset the thermal drift in the system (see section 3.4 temperature compensation ). 1.5.5 physical memory flash memory the 71m6531d and 71m6532d include 128 kb of on - chip flash memory . the 71m6531f and 71m6532 f offer 256 kb of flash memory . the flash memory pri marily contains mpu and ce program code . it also con tains images of the ce and mpu data in ram, as well as of i/o ram . on power - up, before enabling the ce, the mpu copies these images to their respective locations. the flash memory is segmented into ind ividually erasable pages that contain 1024 bytes. f lash space allocated for the ce program is limited to 4096 16 - bit words (8 kb) . the ce program must begin on a 1 - kb boundary of the flash address space . the ce_lctn[ 7 :0] word defines which 1 - kb boundary contains the ce code . thus, the first ce instruction is located at 1024* ce_lctn[7 :0] . the mpu may write to the flash memory. this is one of the non - volatile storage options available to the user in addition to external eeprom. flash write procedures flsh _pwe (flash program write enable) differentiates 80515 data store instructions (movx@dptr,a) between flash and xram write operations . this bit must be cleared by the mpu after each byte write operation. write operations to this bit are inhibited when int errupts are enabled. the mpu cannot write to flash while the ce is executing its code from flash. two interrupts warn of collisions between the mpu firmware and the ce timing. if a flash write operation is attempted while the ce is busy, the flash write will not execute and the fwcol0 interrupt will be issued. if a flash write is still in progress when the ce would otherwise begin a code pass, the code pass is skipped, the write operation is completed, and the fwcol1 interrupt is issued.
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 39 the simplest fla sh write procedure disables the ce during the write operation and interpolates the metering measurements. however, this results in the loss of at least one second of data, because the ce has to resynchronize with the mains voltage. there is a brief guaran teed interval (typically 1/32768 s) between ce executions which occurs 2520 times per second. the start of the interval can be detected with the ce_busy interrupt which occurs on the falling edge of ce_busy (an internal signal measurable from tmuxout). h owever, this guaranteed idle time (30.5 s) is too short to write a byte which takes 42 s or to erase a page of flash memory which takes at least 20 ms. some ce code has substantially longer idle times, but in those cases, firmware in terrupt latencies ca n easily consume the available write time. if a flash write fails in this scheme, the failure can be detected with the fwcol0 or fwcol1 interrupt and the write can be retried. it is practical to pre - erase pages, disable interrupts and poll the ce_busy int errupt flag, ircon[2] . this method avoids problems with interrupt latency, but can still result in a write failure if the ce code takes to much time. as mentioned above, polling fwcol0 and fwcol1 can detect write failures. however, the speed in a pollin g write is only 2520 bytes per second and the firmware cannot respond to interrupts. as an alternative to using flash, a small eeprom can store data without compromises. eeprom interfaces are included in the device. the original state of a flash byte is 0xff (all ones). once a value other than 0xff is written to a flash memory cell, over writing with a different value usually requires that the cell be erased first. since cells cannot be erased individually, the p age has to be copied to ram, followed by a page erase. after this, the page can be updated in ram and then written back to the flash memory. updating i ndividual b ytes in f lash m emo ry flash erasure is initiated by writing a specific data pattern to specific sfr registers in the proper sequence. these special pattern/sequence requirements prevent inadvertent erasure of the flash memory. flash erase procedures the mass erase sequence is: 1. write 1 to the flsh_meen bit ( sfr 0xb2[1] ) . 2. write pattern 0xaa to flsh_erase ( sfr 0x94 ) . the mass erase cycle c an only be initiated when the ice port is enabled. the page erase sequence is: 1. write the page address to flsh_pgadr [5:0] ( sfr 0xb7[7:1] ) . 2. write pattern 0x55 to flsh_erase ( sfr 0x94 ) . the program memory of the 71m6531 consists of a fixed lower bank of 32 kb addressab le at 0x0000 to 0x7fff plus an upper bank area of 32 kb, addressable at 0x8000 to 0xffff . the upper 32 kb space is banked using the i/o ram fl_bank register as follows: bank - switching: ? the 71m6531d provide s 4 banks of 32 kb each selected by f l_bank[1:0] . note that when fl_bank[1:0] = 00, the upper bank is the same as the lower bank. ? the 71m6531f and 71m6532d/f provide 8 banks of 32 kb each selected by fl_bank[2:0] . table 38 illustrates the bank switching mechanism .
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 40 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 table 38 : bank switching with fl_bank[2:0] 7 1m6531 d fl_bank [1:0] 71m653x f fl_bank [2:0] address range for lower bank (0x000 - 0x7fff) address range for upper bank (0x8000 - 0xffff) 000 000 0x0000 - 0x7fff 0x0000 - 0x7fff 001 001 0x 8000 - 0xffff 010 010 0x10000 - 0x17fff 011 011 0x18000 - 0x1ffff 100 0x20000 - 0x217ff 101 0x28000 - 0x2ffff 110 0x30000 - 0x37fff 111 0x38000 - 0x3ffff when enabled, the security feature limits the ice to global flash erase operations only. all other ice op erations are blocked. this guarantees the security of the user?s mpu a nd ce program code. security should be enabled by mpu code that is executed dur in g the pre - boot interval (60 ckmpu cycle s before the primary boot sequence begin s ) . once security is enabled, the only way to disable it is to perform a global erase of the flash, followed by a chip reset. program security the first 60 cycles of the mpu boot code are called the pre - boot phase because during this phase the ice is inhibited. a read - on ly status bit, preboot , identifies these cycles to the mpu. upon completion of pre - boot, the ice can be enabled and is permitted to take control of the mpu. t he security enable bit, secure , is reset whenever the chip is reset. hardware associated with th e bit per mits only ones to be written to it. thus, pre - boot code may set secure to enable the security feature but may not reset it. once secure is set, the pre - boot code is protected and no external read of program code is possible specifically, when s ecure is set , the following applies : ? the ice is limited to bulk flash erase only. ? page zero of flash memory, the preferred location for the user?s pre - boot code, may not be page - erased by either mpu or ice. page zero may only be erased with global flash erase. ? write operations to page zero, whether by mpu or ice are inhibited. mpu/ce ram: the 71m6531 d / f and 71m6532d/f include 4 k b of static ram memory on - chip (xram) plus 256 - bytes of internal ram in the mpu core . the 4 k b of static ram are used for da ta storage for mpu and ce op era tions . 1.5.6 optical interface the device includes an interface to implement an ir/optical port. the pin opt_tx is designed to directly drive an external led for transmitting data on an optical link. the pin opt_rx has the same threshold as the rx pin, but can also be used to sense the input from an external photo detector used as the re ceiver for the optical link. opt_tx and opt_rx are connected to a dedicated uart port (uart1). the opt_tx and opt_rx pins can be inverted with configuration bits opt_txinv and opt_rxinv , re spectively . additionally, the opt_tx output may be modulated at 38 khz . modulation is available when system power is present (i.e. not in brownout mode) . the opt_txmod bit enables modulation . duty cycle i s controlled by opt_fdc[1:0] , which can select 50%, 25%, 12.5% and 6.25% duty cycle . 6.25% duty cycle means opt_tx is low for 6.25% of the period . figure 9 illustrates the opt_tx generator. when not needed for th e optical uart, the opt_tx pin can alternatively be configured as dio2, wpulse, or varpulse . the configuration bits are opt_txe[1:0] . likewise, opt_rx can a lternately be configured as dio 1 . its control is opt_rxdis .
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 41 b a opt_txmod = 0 opt_txmod = 1, opt_fdc = 2 (25%) b a 1 / 38 khz opt_txinv from opt_tx uart mod en duty opt_tx opt_txmod opt_fdc opt_txe[1:0] 1 2 v3p3 internal a b 0 2 3 dio2 wpulse varpulse figure 9 : optical interface 1.5.7 digital i/o ? 71m6531d/f the 71m6531 d/f in cludes up to 22 pins of general - purpose digital i/o . these pins are compatible with 5 v inputs (no current limiting resistors are needed) . the digital i/o pins can be categorized as follows: ? dedicated dio pins (1 pin ): pb ? dio/lcd segment pins (a total of 19 pins) : o dio4/se g24 - dio15/seg35 (12 pins) o dio17/seg37 (1 pin ) o dio28/seg48 ? dio29/seg49 (2 pins) o dio43/seg63 - dio46/seg66 (4 pins ) ? dio pins combined with other f unctions (2 pins): dio2/opt_tx, dio1/opt_rx the pins dio4/seg24 through d io46 /seg 66 are configured by the lcd_ bit map r egisters to be dio or segment pins . a one in lcd_ bit map defines the pin as a lcd segment output, a zero makes the pin a dio pin . pins c onfigured as lcd pins are controlled with the lcd_segnn registers . pins configured as dio can be defined independently as an input or output with the dio_dir bits (see table 45 ). write operation s to a disabled di o are not ignored. write operation s are registered, but do not affect the pin, or the result of a read operation on the pin, until it becomes a dio output. dio2/opt_tx will be an active tx output pin at power up ( opt_tx e[1:0] = 00). a 3 - bit configurat ion word, i/o ram field dio_rx [2:0] (0x2009[2:0] through 0x200e[6:4 ] ) , can be used for certain pins (when configured as dio) to indivi dually assign an internal resource such as an interrupt or a timer control (see table 46 for dio pins available for this option). this way, dio pins can be tracked even if they are configured as outputs. table 39 to table 41 lists the direction reg isters and configurability associated with each group of dio pins.
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 42 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 table 39 : data/direction registers and internal resources for dio 1 - 15 (71m6531 d/f ) dio pb 1 2 ? 4 5 6 7 8 9 10 11 12 13 14 15 lcd segment ? ? ? ? 24 25 26 27 28 2 9 30 31 32 33 34 35 pin number 65 60 3 ? 39 40 41 42 43 44 45 46 68 30 21 22 configuration (dio or lcd segment) ? ? ? ? 0 1 2 3 4 5 6 7 0 1 2 3 lcd_ bit map[31:24] lcd_bitmap[39:32] data register 0 1 2 ? 4 5 6 7 0 1 2 3 4 5 6 7 dio0 = p0 (sfr 0x80) dio1 = p1 (sfr 0x90) direction re gister ? 1 2 ? 4 5 6 7 0 1 2 3 4 5 6 7 dio_dir0 (sfr 0xa2) dio_dir1 (sfr 0x91) internal re sources con figurable ? ? ? ? y y y y y y y y ? ? ? ? table 40 : data/direction registers and internal resources for dio 17 - 29 (71m6531d/f) dio ? 1 7 ? ? ? ? ? ? ? ? ? ? 28 29 ? ? lcd segment ? 37 ? ? ? ? ? ? ? ? ? ? 48 49 ? ? pin number ? 13 ? ? ? ? ? ? ? ? ? ? 47 2 4 ? ? configuration (dio or lcd segment) ? 5 ? ? ? ? ? ? ? ? ? ? 0 1 ? ? lcd_ bit map[39: 32] lcd_ bit map[55:48] data register ? 1 ? ? ? ? ? ? ? ? ? ? 4 5 ? ? dio2 = p2 (sfr 0xa0) dio3 = p3 (sfr 0xb0) direction re gister 0 = input, 1 = output ? 1 ? ? ? ? ? ? lcd_seg48[3] lcd_seg49[3] dio_dir2 (sfr 0xa1) table 41 : data/direction registers and internal resources for dio 43 - 46 (71m6531d/f) dio ? ? ? 43 44 45 4 6 ? lcd segment ? ? ? 63 64 65 66 ? pin number ? ? ? 29 23 28 5 ? configuration (dio or lcd segment) ? ? ? 7 0 1 2 ? lcd_bitmap[63:56] lcd_ bitmap[64:71] data register ? ? ? lcd_seg63 [0] lcd_seg64[0] lcd_seg65[0] lcd_seg66[0] ? direction register 0 = input, 1 = output ? ? ? lcd_seg63 [3] lcd_seg64[3] lcd_seg65[3] lcd_seg66[3] ?
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 43 1.5.8 digital i/o ? 71m6532d/f the 71m6532d/f includes up to 43 pins of general - purpose digital i/o. t hese pins are compatible with 5 v inputs (no current limiting resistors are needed). the digital i/o pins can be categorized as follows: ? dedicated dio pins (4 pin s ): o dio3 o dio56 ? dio58 (3 pins) ? dio/lcd segment pins (a to tal of 37 pins) : o dio4/seg24 ? dio27/seg47 (24 pins) o dio29/seg49, dio30/seg 5 0 (2 pins) o dio40/seg60 ? dio45/seg65 (6 pins) o dio47/seg67 ? dio51/seg71 (5 pins ) ? dio pins combined with other functions (2 pins): dio2/opt_tx, dio1/opt_rx on reset or power - up, all dio pins are inputs until they are configured for the desired direction under mpu control. the pin function can be configured by the i/o ram bits lcd_bitmapn . setting lcd_bitmapn = 1 configures the pin for lcd, setting lcd_bitmapn = 0 configures it for dio. once a pin is configured as dio, it can be configured independently as an input or output with the dio_dir bits or the lcd_segn registers. input and output data are written to or read from the pins using sfr registers p0, p1 , and p2 . table 42 to table 44 shows the dio pins with their configuration, direction control and data registers. table 42 : data/direction registers and internal resour ces for dio 1 - 15 ( 71m6532d/f ) dio pb 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 lcd segment ? ? ? ? 24 25 26 27 28 29 30 31 32 33 34 35 pin number 92 87 3 17 60 61 62 63 67 68 69 70 100 44 29 30 configuration (dio or lcd segment) always dio 0 1 2 3 4 5 6 7 0 1 2 3 lcd_bitmap[31:24] lcd_bitmap[39:32] data register 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 dio0 = p0 (sfr 0x80) dio1 = p1 (sfr 0x90) direction re gister 0 = input, 1 = output ? 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 dio_dir0 (sfr 0xa2) dio_dir1 (sfr 0x91) in ternal re sources con figurable y y y y y y y y y y y y ? ? ? ? table 43 : data/direction registers and internal resources for dio 16 - 30 (71m6532d/f) dio 16 17 18 19 20 21 22 23 24 25 26 27 ? 29 30 ? lcd segment 36 37 18 39 40 41 42 43 44 45 46 47 ? 49 50 ? pin number 33 12 13 64 65 66 93 54 46 43 42 41 ? 32 35 configuration (dio or lcd segment) 4 5 6 7 0 1 2 3 ? ? ? ? ? 1 2 ? lcd_bitmap[39:32] lcd_bitmap[47:40] lcd_bitmap[55:48 ] data register 0 1 2 3 4 5 6 7 0 1 2 3 ? 5 6 ? dio2 = p2 (sfr 0xa0) dio3 = p3 (sfr 0xb0) direction re gister 0 = input, 1 = output ? 1 ? 3 4 5 ? ? ? ? ? ? ? lcd_seg49[3] lcd_seg50[3] ? dio_dir2 (sfr 0xa1)
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 44 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 table 44 : data/direction registers and internal resources for dio 40 - 51 (71m6532d/f) dio 40 41 42 43 44 45 ? 47 48 49 50 51 lcd segment 60 61 62 63 64 65 ? 67 68 69 70 71 pin number 95 97 98 40 31 38 ? 22 23 24 25 50 configuration (dio or lcd segment) 4 5 6 7 0 1 ? 3 4 5 6 7 lcd_bitmap[63:56 ] lcd_bitmap[71:6 4] data register lcd_seg60[0] lcd_seg61[0] lcd_seg62[0] lcd_seg63[0] lcd_seg64[0] lcd_seg65[0] ? lcd_seg67[0] lcd_seg68[0] lcd_seg69[0] lcd_seg70[0] lcd_seg71[0] direction register 0 = input, 1 = output lcd_seg60[0] lcd_seg61[0] lcd_seg62[0] lcd_seg63[0 ] lcd_seg64[3] lcd_seg65[3] ? lcd_seg67[3] lcd_seg68[3] lcd_seg69[3] lcd_seg70[3] lcd_seg71[3] dio24 and higher do not have sfr registers for direction control. dio40 and higher do not have sfr re gisters for data access. the direction control of these pins is achieved with the lcd_segn[3] bits and data access is controlled with the lcd_segn[0] bits in i/o ram. dio56 through dio58 are dedicated dio pins. they are controlled with dio_dir56[7] through dio_dir58[7] and with dio_56[4] through dio_58[4] in i/o ram. 1.5.9 d igital io ? common characteristics for 71m6531d/f and 71m6532d/f on reset or power - up, all dio pins are inputs until they are configured for the desired direction under mpu control. the pin function can be configured by the i/o ram bits lcd_bi tmapn . setting lcd_bitmapn = 1 configures the pin for lcd, setting lcd_bitmapn = 0 configures it for dio. once a pin is configured as dio, it can be configured independently as an input or output with the dio_dir bits or the lcd_segn registers. input a nd output data are written to or read from the pins using sfr registers p0, p1 , and p2 . dio24 and higher do not have sfr registers for direction control. dio 40 and higher do not have sfr registers for data access. the direction control of these pins is a chieved with the lcd_segn[3] registers and data access is controlled with the lcd_segn[0] registers in i/o ram. since the control for dio 24 through dio51 is shared with the control for lcd segments, the firmware must take care not to disturb the dio pins when accessing the lcd segments and vice versa. usually, this requires reading the i/o ram register, applying a mask and writing back the modified byte. table 45 : dio_dir control bit dio_dir [n] 0 1 dio pin n function input output table 46 : selectable control using dio_dir bits dio_r value resource selected for dio pin 0 none 1 reserved 2 t0 (counter 0 clock) 3 t1 (counter 1 clock) 4 high priority i/o interrupt (int0 rising) 5 low priority i /o interrupt (int1 rising) 6 high priority i/o interrupt (int0 falling) 7 low priority i/o interrupt (int1 falling)
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 45 additionally, if dio6 and dio7 are configured as dio and defined as outputs, they can be used as dedi cated pulse outputs (wpulse = dio 6, varpulse = dio7) u sing the dio_pw and dio_pv bits . in this case, dio6 and dio7 are under ce control. dio4 and dio5 can be configured to implement the eeprom interface. the pb pin is a dedicated digital input. in addition, if the optical uart is not u sed, opt_tx and o pt_rx can be co nfigured as dedicated dio pins, dio1 and dio2, respectively (see section 1.5.6 optical interface ). the internal control resources selec table for the dio pins are listed in table 46 . if more than one input is connected to the same resource, the resources are combined using a logical or. tracking dio pins configured as outputs is useful for pulse counting without external hardware. either the interrupts or the counter/timer clocks can be used to count pulses on the pulse outputs or interrupts on the ce?s power failure output. when driving leds, relay coils etc., the dio pins should sink figure 10 the curre nt into gndd (as shown in , right), not figure 10 source it from v3p3d (as shown in , left). this is due to the re sis - tance of the i n ternal switch that connects v 3p3d to either v3p3sys or vbat. sourcing current in to or out of dio pins other t han the pb pin , for ex ample with pull - up or pull - down resistors, should be avoided. violating this rule will lead to increased quiescent current in sleep and lcd modes. f ig ure 10 : connecting an external load to dio pins 1.5.10 lcd drivers ? 71m6531d/f the 71m6531 contains a total of 39 dedicated and multiplexed lcd drivers which are grouped as follows: ? 11 dedicated lcd segment drivers ? always available ? 3 drivers multiplexed with the ice interface (e_tclk, e_rst, e_rxtx) ? available in normal operation mode (when not emulating) ? 2 driver multiplexed with auxiliary signal s mux_sync and cktest (seg7, seg19) ? available when not used for test ? 4 drivers multiple xed with the spi port (pclk, psdo, pcsz, psdi) ? 19 multi - use pins desc ribed in section 1.5.7 digital i/o ? 71m6531d/f . ? 4 common drivers for multiplexing (25%, 33%, 50%, o r 100% duty cycle) ? always available with a minimum of 16 driver pins always available and a total of 39 driver pins in the maximum con figuration, the device is capable of driving between 64 to 156 pixels of lcd display with 25% duty cycle . at eight pi xels per digit, this corresponds to 8 to 19 digits . at 33% duty cycle, 48 to 117 pixels can be driven . for each multi - use pin, the corresponding lcd_bitma p[] bit ( see section 1.5.7 digital i/o ? 71m6531d/f ) , is used to select the pin for dio or lcd operation . the mapping of the lcd_bitmap[] bits is specified in v3p3sys vbat v3p3d dio gndd mission brownout lcd/sleep low high high-z v3p3sys vbat v3p3d dio gndd mission brownout lcd/sleep low high high-z
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 46 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 section 4.1 i/o ram an d sfr map ? functional order . the lcd drivers are supported by the four common pins (com0 ? com3). 1.5.11 lcd drivers ? 71m6532d/f th e 71m6532d/f contains a total of 67 dedicated and multiplexed lcd drivers, which are grouped as follows: ? 15 dedicated lcd segme nt drivers (seg0 to seg2, seg8, seg12 - seg18 , seg20 ? seg23 ) ? 4 drivers multiplexed with the spi port (seg3 to seg6) ? 2 driver s multiplexed with mux_sync (seg7) or cktest (seg19) ? 3 drivers multiplexed with the ice interface (seg9 to seg11) ? 43 multi - use lcd/ dio pins described in section 1.5.8 digital i/o ? 71m6532d/f . with a minimum of 15 driver pins al ways available and a total of 6 7 driver pins in the maximum con figurat ion, the device is capa ble of driving between 60 to 26 8 pixels of an lcd display with 25% duty cycle. at eight pixels per digit , this corresponds to 7.5 to 3 3.5 digits. for each multi - use pin, the corresponding lcd_bitmap[ ] bit ( see section 1.5.8 digital i/o ? 71m6532d/f ) , i s used to select the pin for dio or lcd operation. the mapping of the lcd_bitmap[ ] bits is specified in section 4.1 i/o ram and sfr map ? functional order . the lcd drivers are supported by the four co mmon pin s (com0 ? com3) . 1.5.12 lcd drivers ? common characteristics for 71m6531d/f and 71m6532d/f the lcd interface is flexible and can drive 7 - segment digits, 14 - segment digits or enunciator symbols. the lcd bias may be compensated for temperature using the lcd_dac[2:0] bits in i/o ram. the bias may be adjusted from 1.4 v below the 3.3 v supply (v3p3sys in mission mode and brownout modes, vbat in lcd mode). when the lcd_dac[2:0] bits are set to 000, the dac is bypassed and powered down. this can be used to reduce current in lcd mode. segment driver s seg18 and seg19 can be configured to blink at either 0.5 hz or 1 hz. the blink rate is controlled by lcd_y . there can be up to four pixels/segments connected to each of these drivers. lcd_blkmap18[3:0] and lcd_blkmap19[3:0] identify which pixels, if any, are to blink. the most sig nificant bit corresponds to com3, the le ast significant to com0. 1.5.13 battery monitor the battery voltage is measured by the adc during alternative mux frames if the bme (battery measure enable) bit is set . while bme is set, an on - chip 45 k ? load resistor is applied to the battery and a scaled fract ion of the battery voltage is applied to the adc input . after each alternative mux frame, the result of the adc conversion is available at ram address 0x0b . bme is ignored and assumed zero when system power is not available . if vbat is connected to a drained battery or disconnected, a battery test that sets bme may drain vbat?s supply and cause the oscillator to stop. a stopped oscillator may force the device to reset. therefore, an unexpected reset during a battery test should be interpreted as a b attery failure. battery measurement is not very linear but is very reproduci ble if properly calibrated . the best way to perform the calibration is to set the battery input to the desired failure voltage and then have the mpu firmware record that measurem ent. after this, the battery measurement logic may use the recorded value as the battery failure limit. the same value can also be a calibration offset for any battery voltage display. see section 5.4.4 battery monitor for details regarding the adc lsb size and the conversion accuracy. 1.5.14 eeprom interface the 71m6531 d / f and 71m6532d/f provide hardware support for either a two - pin or a three - wire ( - wire) type of eeprom in terfa ce. the interfaces use the eectrl and eedata registers for communication .
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 47 two - pin eeprom interface the dedicated 2 - pin serial interface communicates with external eeprom devices . the interface is mul tiplexed onto the dio4 (sck) and dio5 (sda) pins and is selected by setting dio_eex[1:0] = 01. the mpu communicates with the interface through the sfr registers eedata and eectrl . if the mpu wishes to write a byte of data to the eeprom, it places the data in eedata and then writes the transmit code to eectrl . this initiates the transmit operation which is finished when the busy bit falls . int5 is also asserted when busy falls . the mpu can then check the rx_ack bit to see if the eeprom acknowledged the trans mission. a byte is read by writing the rec eive command to eectrl and waiting for the busy bit to fall . upon completion, the received data is in eedata . the serial transmit and receive clock is 78 khz during each transmission and then holds in a high state until the next transmission . the eectrl bits when the two - pin interface is selected are shown in table 47. table 47 : eectrl bits for 2 - pin interface status bit name read/ write reset state polarity description 7 error r 0 posi tive 1 when an illegal command is received. 6 busy r 0 positive 1 when serial data bus is busy. 5 rx_ack r 1 negative 0 indicates t hat the eeprom sent an ack bit. 4 tx_ack r 1 negative 0 indicates when an ack bit has been sent to the eeprom . 3:0 cmd[3: 0] w 0000 positive cmd[3:0] operation 0000 no - op command. stops the i 2 c clock (sck, dio4). if not issued, sck keeps toggling. 0010 receive a byte from the eeprom and send ack. 0011 transmit a byte to the eeprom. 0101 issue a stop sequence. 0110 rec eive the last byte from the eeprom and do not send ack. 1001 issue a start sequence. others no operation, set the error bit. the eeprom interface can also be operated by controlling the dio4 and dio5 pins directly. in this case, a resistor has to b e used in series with sda to avoid data collisions due to limits in the speed at which the sda pin can be switched from output to input. c ontrolling dio4 and dio5 di rect ly is discouraged, because it may tie up the mpu to the point where it may become to o busy to pro cess interrupts . three - wire ( - wire) eeprom interface a 500 khz three - wire interface, using sdata, sck and a dio pin for cs is available . the interface is selected by setting dio_eex[1:0] = 2 (b 10) . the eectrl bits when the three - wire inte rface is selected are shown in table 48. when eectrl is written, up to 8 bits from eedata are either written to the eeprom or read from the eeprom, depending on the values of the eectrl bits. the - wire eeprom i nterface is only functional when mpu_div[2:0] = 000.
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 48 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 table 48 : eectrl bits for the 3 - wire interface control bit name read/ write description 7 wfr w wait for ready . if this bit is set, the trailing edge of busy will be de layed until a rising edge is seen on the data line . this bit can be used during the last byte of a write command to cause the int5 interrupt to occur when the eeprom has finished its internal write sequence . this bit is ignored if hiz = 0. 6 busy r asserted while the serial data bus is busy . when the busy bit falls, an int5 interrupt occurs. 5 hiz w indicates that the sd signal is to be floated to high impedance immedi ately after the last sck rising edge. 4 rd w indicates that eedata is to be filled with data from eeprom. 3 :0 cnt[3:0] w specifies the number of clocks to be issued . allowed values are 0 through 8 . if rd=1, cnt bits of data will be read msb first and right justified into the low order bits of eedata . if rd=0, cnt bits will be sent msb fir st to the eeprom, shifted out of the msb of eedata . if cnt[3:0] is zero, sdata will simply obey the hiz bit. the timing diagrams in figure 11 through figure 15 describe the 3 - wire eeprom interface behavior . all commands begin when the eectrl register is written . transactions start by first raising the dio pin that is connected to cs . multiple 8 - bit or less commands such as those shown in figure 11 through figure 15 are then sent via eectrl and eedata . when the transaction is finished, cs must be lowered . at the end of a read transaction, the eeprom will be driving sdata, but will tran sition to hiz (high impedance) when cs falls . the firmware should then immediately issue a write command with cnt=0 and hiz=0 to take control of sdata and force it to a low - z state. figure 11 : 3 - wire interface . write command, hiz=0 figure 12 : 3 - wire interface . write command, hiz=1 sclk (output) busy (bit) cnt cycles (6 shown) sdata (output) write -- no hiz d2 d3 d4 d5 d6 d7 eectrl byte written int5 sdata output z (loz) cnt cycles (6 shown) write -- with hiz int5 eectrl byte written sclk (output) busy (bit) sdata (output) d2 d3 d4 d5 d6 d7 (hiz) (loz) sdata output z
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 49 figure 13 : 3 - wire interface . read command. figure 14 : 3 - wire interface . write command when cnt=0 figure 15 : 3 - wire interface . write command when hiz=1 and wfr=1 1.5.15 spi slave port the slave spi port communicates directly with the mpu data bus and is able to read and write data ram locations . it is also able to send commands to the mpu . the interface to the slave port consists of the pcsz, pclk, psdi and psdo pins . these pins are multiplexed with the lcd segment driver pins seg3 to seg6 . the port pins default to lcd driver pins . the port is enabled by setting the spe bit . a typical sp i transaction is as follows . while pcsz is high, the port is held in an initialized/reset state . during this state, psdo is held in hiz state and all transitions on pclk and psdi are ignored . when pcsz falls, the port will begin the transaction on the f irst rising edge of pclk . a transaction consists of an 8 - bit command, a 16 - bit address and then one or more bytes of data . the transaction ends when pcsz is raised . some transactions may consist of a command only . the last spi command and a ddress (if p art of the command) are available to the mpu in registers sp_cmd and sp_addr . the spi port supports data transfers at 1 mb/s in mission mode and 16 kb/s in brownout mode . the spi commands are described in table 49 and in figure 16 illustrate the spi interface read and write timing. cnt cycles (8 shown) read d0 d1 d2 d3 d4 d5 int5 d6 d7 eectrl byte written sclk (output) busy (bit) sdata (input) sdata output z (hiz) cnt cycles (0 shown) write -- no hiz d7 int5 not issued cnt cycles (0 shown) write -- hiz int5 not issued eectrl byte written eectrl byte written sclk (output) busy (bit) sdata (output) sclk (output) busy (bit) sdata (output) (hiz) sdata output z sdata output z (loz) cnt cycles (6 shown) write -- with hiz and wfr eectrl byte written sclk (output) busy (bit) sdata (out/in) d2 d3 d4 d5 d6 d7 busy ready (from eeprom) int5 (from 6520) sdata output z (hiz) (loz)
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 50 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 table 49 : spi c ommand description command description 11xx xxxx addr byte0 ... byten read data starting at addr. the addr will auto - increment until pcsz is raised. upon completion: sp__ cmd =11xx xxxx, sp_ addr =addr+n+1 . no mpu inter rupt is generated if the command is 1100 0000. otherwise , an spi interrupt is generated. 10xx xxxx addr byte0 ... byten write data starti ng at addr. the addr will auto - increment until pcsz is raised. up on completion: sp_ cmd =10xx xxxx, sp_ addr =addr+n+1 . no mpu inter rupt is generated if the command is 1000 0000. otherwise, an spi interrupt is generated. certain i/o ram registers can be written and read using the spi port (see table 50) . however, the mpu takes priority over the i/o ram bus, and spi operation may fail without notice. to avoid this situation, the spi host should send a command other than 11xxxxxx or 10xxxxxx (read or write) before the actual read or write command. the spi slave interface will load the command register and generate an int2 inte r- rupt upon receiving the command. the mpu should service the interrupt and halt any external data memory operations to effectively grant the bus to the spi. when the spi host finishes, it should send another command so the mpu can release the bus. there are no issues with data ram access; spi and the mpu will share the bus with no conflicts for data ram ac cess. table 50 : i/o ram registers accessible via spi name address (hex) bit range read/write ce0 2000 7:3 rw ce1 2001 7:0 rw ce2 2002 5:3, 1:0 rw config0 2004 7:6, 3 :0 rw config1 2005 5:2, 0 rw version 2006 7:0 r config2 2007 7:0 rw dio0 2008 7 :6 , 4:0 rw dio1 to dio6 2009 to 200e 6:4, 2:0 rw ? 200f 7:6, 3:2 rw rtm0h 2060 1:0 rw rtm0l 2061 7:0 rw rtm1h 2062 1:0 rw rtm1l 2063 7:0 rw rtm2h 2064 1:0 rw rtm2l 2065 7:0 rw rtm3h 2066 1:0 rw rtm3l 2067 7:0 rw pls_w 2080 7 :0 rw pls_i 2081 7:0 rw slot0 to slot9 2090 to 209a 7:0 rw ce3 209d 3:0 rw ce4 20a7 7:0 rw ce5 20a8 7:0 rw wake 20a9 7:5, 3:0 r config3 20ac 5:4, 1 :0 rw config4 20ad 5:4, 1 :0 rw ? 20af 2:0 rw
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 51 name address (hex) bit range read/write spi0 20b0 4, 0 rw spi1 20b1 4, 0 r version 20c8 7:0 r chip_id 20c9 7:0 r trimsel 20fd 4:0 rw trimx 20fe 0 rw trim 20ff 7:0 rw a15 a14 a1 a0 c0 0 31 x d7 d6 d1 d0 d7 d6 d1 d0 c5 c6 c7 x pcsz psck psdi psdo 8 bit cmd 16 bit address data[addr] data[addr+1] 7 8 23 24 32 39 extended read . . . serial read a15 a14 a1 a0 c0 0 31 c5 c6 c7 x pcsz psck psdi psdo 8 bit cmd 16 bit address data[addr] data[addr+1] 7 8 23 24 32 39 extended write . . . serial write d7 d6 d1 d0 d7 d6 d1 d0 x hi z hi z (from host) (from 6531) (from host) (from 6531) figure 16 : spi slave port : typical r ead and w rite operations possible applications for the spi interface are: 1) an external host reads data from ce locations to obtain metering information. this can be used in applications where the 71m6531 d/f or 71m6532d/f function as smart front - end s with preprocessing capability. since the addresses are in 16 - bit format, any type of xram d ata can be accessed: ce, mpu, i/o ram, but not sfrs or the 80515 - internal register bank. 2) a communication link can be established via the spi interface: by writing into mpu memory locations, the external host can initiate and control processes in the mpu of the 71m6531 d/f or 71m6532d/f . writing to a ce or mpu location normally generates an interrupt, a function that can be used to signal to the mpu that the byte that had just been written by the external host must be read and processed. data can also be i nserted by the external host without generating an interrupt. 3) an external dsp can access front - end data generated by the adc. this mode of operation uses the 71m6531 d/f or 71m6532d/f as an analog front - end (afe).
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 52 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 v3p3 v3p3 - 400mv v3p3 - 10mv vbias 0v battery modes normal operation, wdt enabled wdt dis- abled v1 1.5.16 hardware watchdog timer a n independent, robust, fixed - duration, watchdog timer (wdt) is included in the 71m6531 d/f and 71m6532d/f . it uses the rtc crystal oscillator as its time base and must be refreshed by the mpu fir m ware at least every 1.5 seconds . when not re freshed on time , the wdt over flows and the part is reset as if the reset pin were pulled high, except that the i/o ram bits will be in the same state as after a wake - up from sleep or lcd modes (see the i/o ram description in section 4.2 for a list of i/o ram bit states after reset and wake - up) . 4100 oscillator cycles (or 125 ms) after the wdt overflow, the mpu will be launched from program address 0x0000. a status bit, wd_ovf, is set when the wdt overflow occurs . this bit is powered by the non volatile supply and can be read by the mpu when wake rises to determine if the part is initializing after a wdt overflow event or after a power - up . after it is read, the mpu firmware must clear wd_ovf . the wd_ovf bit is also cleared by the reset pin . there is no internal digital state that deactivates the wdt. figure 17 : functions defined by v1 t he wdt can be disabled by tying the v1 pin to v3p3 (see figure 17) . of course, this also deactivates v1 power fault detection . since there is no method in firmware to disable the crystal oscillator or the wdt, it is guaranteed that whatever state the part might find itself in, upon watchdog overflow, the part will be reset to a known sta te. asserting ice_e will also deactivate the wdt . this is the only method that will work in brownout mode . in normal operation, the wdt is reset by periodically writing a one to the wdt_rst bit . the watchdog timer is also reset when the internal signal wake = 0 (see section 2.5 wake - up behavior ). if enabled with the ien_wd_nrovf bit in i/o ram, an interrupt occurs roughly 1 ms before the wdt resets the chip . this can be used to determine the cause of a wdt reset since it allows the code to log its state (e.g. the current pc value, loop counters, flags, etc.) before a wdt reset occurs.
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 53 1.5.17 test ports (tmuxout pin) one of the digital or analog signals listed in table 51 can be selected to be output on the tmuxout pin . the function of the multiplexer is controlled with the i/o ram field tmux [4:0] (0x20aa [4:0]), as shown in table 51. table 51 : tmux[4:0] selections tmux[4:0] mode function 0 analog gndd 1 analog reserved 2 analog gndd 3 analog reserved 4 analog pll_2p5 5 analog output of the 2.5 v low - power regulator 6 analog internal vbias voltage (nominally 1.6v) 7 analog not used 8 - 0x0f ? reserved 0x10 digital rtc 1 - second output 0x11 digital rtc 4 - second output 0x12 ? not used 0x13 digital v1_ok comparator output 0x14 digital real - time output (rtm) from the ce 0x15 digital wdtr_en (comparator 1 output and v1lt3) 0x16 ? 0x17 ? not used 0x18 digital rxd (from optical interface, w/ optional inversion) 0x19 digital mux_sync 0x1a ? not used 0x1b digital ckmpu (mpu clock) 0x1c digital pulse output 0x1d digital rtclk (output of the oscillator circuit, n ominally 32,786hz) 0x1e digital ce_busy (busy interrupt generated by ce, 396s) 0x1f digital xfer_busy (transfer busy interrupt generated by the ce, nominally every 999.7ms) the tmuxout pin may be used for diagnosis purposes or in production test . the rtc 1 - second output may be used to calibrate the crystal oscillator . the rtc 4 - second output provides even higher precision.
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 54 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 2 f unctional d escription 2.1 theory of operation the energy delivered by a power source into a load can be expressed as: = t dt t i t v e 0 ) ( ) ( assuming phase angles are constant, the following formulae apply: ? p = real energy [wh] = v * a * cos 3 * t ? q = reactive energy [varh] = v * a * sin 3 * t ? s = apparent energy [vah] = 2 2 q p + for a practical meter, not only volta ge and current amplitudes, but also phase angles and harmonic content may change constantly . thus, simple rms measurements are inherently inaccurate . a modern solid - state electricity meter ic such as the teridian 71m6531 functions by emulating the integr al operation above, i.e. it processes current and voltage samples through an adc at a constant frequency . as long as the adc resolution is high enough and the sample frequency is beyond the harmonic range of interest, the current and voltage samples, mult iplied with the time period of sampling will yield an accurate quantity for the momentary energy . summing up the momentary energy quantities over time will result in accumulated energy. figure 18 : voltage , current, momentary and accumulated energy figure 18 shows the shapes of v(t), i(t), the momentary power and the accumulated power, resulting from 50 samples of the voltage and current signals over a period of 20 ms . the application of 240 vac and 100 a results in an accumulation of 480 ws (= 0.133 wh) over the 20 ms period, as indicated by the a ccumulated p ower curve . the described sampling method works reliably, even in the presence of dynamic phase shift and harmonic distortion. -500 -400 -300 -200 -100 0 100 200 300 400 500 0 5 10 15 20 current [a] voltage [v] energy per interval [ws] accumulated energy [ws]
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 55 2.2 sy stem timing summary figure 19 s ummarizes the timing relationships between the input mux states, the ce_busy signal and the two serial output streams . in this example, mux_div[3:0] = 4 and fir_len[1:0] = 2 (384 ce cycles , 3 ck32 cycles per conversion ) , resulting in 13 ck32 cycles per multiplexer frame . generally, t he duration of each mux frame is : ? 1 + mux_div * 1 , if fir_len[1:0] = 0 (138 ce cycles) ? 1 + mux_div * 2 , if fir_len[1:0] = 1 (288 ce cycles) ? 1 + mux_div * 3 , if fir_len[1:0] = 2 (384 ce cycles) . an adc conversion will always consume an integer number of ck32 clocks . following this is a single ck32 cycle where the bandgap voltage is allowed to recover from the change in cross. figure 19 : timing relationship between adc mux, compute engine each ce program pass begins when the adc0 conversion (for ia) begins. depending on the length of the ce program, it may continue running until the end of the last conversion ( adc 3 ). ce opco des are constructed to ensure that all ce code passes consume exactly the same number of cycles. the result of each adc conversion is inserted into the ram when the conversion is complete. the ce code is written to tolerate sudden changes in adc data. t he exact clock count when each adc value is loaded into ram is shown in figure 19 . figure 20 shows that the serial data stream, rtm, begins transmitting at the beginning o f state s. rtm, consisting of 140 ck cycles, will always finish before the next code pass starts. flag rtm data 0 (32 bits) 0 1 0 1 0 1 0 1 flag flag flag ck32 mux_sync cktest tmuxout/rtm lsb lsb sign sign lsb sign 30 31 30 31 30 31 30 31 lsb sign rtm data 1 (32 bits) rtm data 2 (32 bits) rtm data 3 (32 bits) figure 20 : rtm output format ck32 mux state 0 mux_div=4 (4 conversions) is shown settle adc mux frame adc execution s mux_sync s ce_execution max ck count 0 450 150 900 1350 1800 adc0 adc1 adc2 adc3 ck count = ce_ cycles + floor((ce _cycles + 2) / 5) notes: 1. all dimensions are 5mhz ck counts. 2. the precise frequency of ck is 150*crystal frequency = 4.9152mhz. 3. xfer_busy occurs once every (pre_samps * sum _cycles) code passes. ce_busy xfer_busy initiated by a ce opcode at end of summation interval adc timing ce timing 1 2 3
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 56 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 2.3 battery modes shortly after system power (v3p3sys) is applied, the part w ill be in mission mode . mission mode means that the part is operating with system power and that the internal pll is stable . this mode is the normal operation mode where the part is capable of measuring energy. when system power is not available (i.e. wh en v1 vbias v1 <= vbias lcd_only reset & vbat_ok reset ie_pllrise ie_pllfall ie_pb ie_wake pb timer timer pb reset & v3p3sys rises v3p3sys rises vbat_ok vbat_ok vbat_ok vbat_ok sleep
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 57 to facilitate transition to sleep mode, which is useful when an unprogrammed ic is mounted on a pcb with a battery installed , the teridian production test programs the following six - byte sequence into the flash location starting at address 0x00000: 0x74 - 0x40 - 0x90 - 0x20 - 0xa9 - 0xf0. this sequence d e- codes to the following assembler code: 0000: 7440 mov a,#40 ; set bit 6 in accumulator 0002: 9020a9 mov dptr,#20a9 ; point to i/o ram address 0x20a9 0005: f0 movx @dptr,a ; set bit 6 (sleep) in 0x20a9 transitions from both lcd and sleep mode are initiated by the wake - up timer timeout conditions or pushbutton events . when the pb pin is pulled high (pushbutton is pressed), the ie_pb interrupt flag (sfr 0xe8[4]) is set, and when the wake - up timer times out, the ie_wake interrupt flag (sfr 0xe8[5]) is set. in the absence of system power, if the voltage margin for the ldo regulator p roviding 2.5 v to the internal circuitry becomes too low to be safe, the part automatically enters sleep mode (bat_ok false) . the battery voltage must stay above 3 v to ensure that bat_ok remains true . under this condition, the 71m6531 stays in sleep mod e, even if the voltage margin for the ldo improves (bat_ok true). table 52 shows the circuit functions available in each operating mode. table 52 : available circuit functions circuit func tion system power battery power (nonvolatile supply) mission brownout lcd sleep ce yes ? ? ? ce data ram yes yes ? ? fir yes ? ? ? analog circuits yes ? ? ? mpu clock rate from pll, as defined by mpu_div[2:0] 28.672 khz (7/8 of 32768 hz) ? ? mpu_di v[2:0] yes ? ? ? ice yes yes ? ? dio pins yes yes ? ? watchdog timer yes yes ? ? lcd yes yes yes ? eeprom interface (2 - wire) yes yes (8 kb/s) ? ? eeprom interface (3 - wire) yes yes (16 kb/s) ? ? uart yes 300 bd ? ? optical tx modulation yes ? ? ? f lash read yes yes ? ? flash page erase yes yes ? ? flash write yes ? ? ? ram read and write yes yes ? ? wakeup timer yes yes yes yes osc and rtc yes yes yes yes x ram data preservation yes yes ? ? v3p3d voltage output pin yes yes ? ? gpo ? gp7 regis ters yes yes yes yes ? indicates not active 2.3.1 brownout mode in brownout mode, most non - metering digital functions are active ( as shown in table 52 ) , i ncluding ice, uart, eeprom, lcd and rtc . in brown out mode, a low bias current regulator will provide 2.5 volts to v2p5 and v2p5nv . the regulator has an output called bat_ok to indicate that it has sufficient overhead . when bat_ok = 0, the part will enter sleep mode . from brownout mode, the processor
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 58 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 can voluntar ily enter lcd or sleep modes . when system power is re stored, the part will automatically transition from any of the battery modes to mission mode, once the pll has settled. the mpu will run at 7/8 of the c rystal clock rate . this permits the uarts to be operated at 300 bd . in this mode, the mpu clock has substantial short - term jitter. the value of mpu_div[2:0] will be remembered (not changed) as the part enters and exits brownout . mpu_div[2:0] will be ignored during brownout. while pll_ok = 0, the i/o ram bits adc_e and ce_e are held in the zero state disabling both the adc and the ce . when pll_ok falls, the ce program counter is cleared immediately and all fir processing halts . 2.3.2 lcd mode in lcd mode, the data contained in the lcd_seg n[3:0] fields is displayed . u p to four lcd segments , each connected to pin s seg18 and seg19 , can be made to blink without the involvement of the mpu, which is disabled in lcd mode. to minimize power, only segments that might be used should be enabled. lcd mode can be exited only by system power up, a timeout of the wake - up timer, or a push button. when the ic exits lcd mode, the mpu can discover the event that caused the exit by reading the interrupt flags and interpret them as follows: ? ie_wake = 1 indicates that the wake timer has expired. ? ie_pb =1 indicates that the pushbutton input (pb) was activated. ? compstat = 0 indicates that a reset occurred but that main power is not yet available. ? if none of the above conditions applies , system power (v3p3sys) must have been r estored after the transition from lcd mode to mission or brownout mode, the pc will be at 0x0000, the xram is in an undefined state and the i/o ram is only partially preserved (see the description of i/o ram states in section 4.2 ). the gp 0 [7:0] through gp7 [7:0] registers are preserved unless reset goes high. 2.3.3 sleep mode in sleep mode, the battery current is minimized and only the oscillator and rtc functions are active . this mode can be exited only by syst em power - up, a timeout of the wake - up timer, or a push button event . when the ic exits sleep mode, the mpu can discover the event that caused the exit by reading the interrupt flags and interpret them as follows: ? ie_wake = 1 indicates that the wake timer has expired. ? ie_pb =1 indicates that the pushbutton input (pb) was activated. ? compstat = 0 indicates that a reset occurred but that main power is not yet available. ? if none of the above conditions applies , system power (v3p3sys) must have been restored a fter the transition from sleep mode to mission or brownout mode the pc will be at 0x0000, the xram is in an undefined state and the i/o ram is only partially preserved (see the description of i/o ram states in section 4.2 ). the gp0[7:0] through gp7 [7:0] registers are preserved unless reset goes high.
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 59 figure 22 : transition from brownout to mission mode when system power returns figure 23 : power - up timing wi th v3p3sys and vbat tied together time system power (v3p3sys) mpu mode battery current transition mpu clock source xtal pll (4.2mhz/mux_div) pll_ok mission 2048...4096 ck32 cycles 300na 13..14 ck cycles wake brownout v1_ok time v3p3sys and vbat mpu mode battery current mpu clock source xtal pll (4.2mhz) pll_ok mission 300na wake internal resetz brown- out 1024 ck32 cycles 14.5 ck32 cycles 4096 ck32 cycles v1_ok
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 60 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 figure 24 : power - up timing with vbat only 2.4 fault and reset behavior 2.4.1 reset mode when the reset pin is pulled high, all digital activity stops . the oscillator and rtc module continue to run . ad ditionally, all i/o ram bits are set to their default states . as long as v1, the input voltage at the power fault block, is greater than vbias, the internal 2.5 v regulator will continue to provide power to the digital section. once initiated, the reset m ode will persist until the reset timer times out, signified by wake rising . this will occur in 4100 cycles of the real time clock after reset goes low, at which time the mpu will begin executing it ? s pre - boot and boot sequences from address 00 . see the program security description in the flash memory section for additional description s of pre - boot and boot. if system power is not present, the reset timer duration will b e 2 cycles of the crystal clock at which time the mpu will begin executing in brownout mode, starting at address 00. 2.4.2 power fault circuit the 71m6531 d / f and 71m6532d/f include a comparator to monitor system power fault conditions . when the output of the comp arator fall s (v1 fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 61 2.5 wake - up behavior as described above, the part will always wake up in mission mode when system power is restored . ad ditionally, the part will wake up in brownout mode when pb rises (push button is pressed) or when a time out of the wake - up timer occurs . 2.5.1 wake on pb if the part is in sleep or lcd mode, it can be awakened by a rising edge on the pb pin . this pin is nor mally pulled to gnd and can be pulled high by a push button depression . before the pb signal rises, the mpu is in reset due to wake bein g low . when pb rises, wake rises and within three crystal cycles, the mpu begins to execute . the mpu can determine whether the pb signal woke it up by checking the ie_pb flag . figure 25 shows the wake up timing. for debouncing, the pb pin is monitored by a state machine operating from a 32 hz clock . this circuit will reject between 31 ms and 62 ms of noise . detection hardware will ignore all transitions after the initial rising edge . this will continue until the mpu clears the ie_pb bit. figure 25 : wake up timing 2.5.2 wake on timer if the part is in sleep or lcd mode, it can be awakened by the wake - up timer . until this timer times out, the mpu is in reset due to wake being low . when th e wake - up timer times out, the wake signal rises and within three crystal cycles, the mpu begins to execute . the mpu can determine whether the timer woke it by checking the autowake interrupt flag ( ie_wake ). the wake - up timer begins timing when the part enters lcd or sleep mode . its duration is controlled by wake_prd[2:0] and wake_res . wake_res selects a timer lsb of either 1 minute ( wake_res = 1) or 2.5 seconds ( wake_res = 0) . wake_prd[2:0] selects a duration of from 1 to 7 lsbs. the timer is armed b y wake_arm = 1 . it must be armed at least three rtc cycles before sleep or lcd_only is initiated . setting wake_arm presets the timer with the values in wake_res and wake_prd and readies the timer to start when the pro cessor writes to sleep or lcd_only . the timer is reset and disarmed whenever the processor is awake . thus, if it is de sired to wake the mpu periodically (every 5 seconds, for example) the timer must be rearmed every time the mpu is awakened. 2.6 data flow the data flow between the compute en gine ( ce ) and the mpu is shown in figure 26 . in a typical application , the 32 - bit ce se quen tially processes the samples from the voltage inputs on pins ia, va, ib and vb, performing calculations to measure act ive power (wh), reactive power (varh), a 2 h and v 2 h for four - quadrant metering . these measurements are then accessed by the mpu, processed further and output using the peripheral devices available to the mpu. figu re 26 illustrates the ce/mpu data flow. time system power (v3p3sys) mpu mode pll_ok 15 ck32 cycles wake lcd pb or wake- up timer brownout
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 62 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 figure 26 : mpu/ce data flow 2.7 ce/mpu communication figure 27 shows the functional relationship s between the ce and the mpu . the ce is controlled by the mpu via shared registers in the i/o ram and in ram . the ce outputs two interrupt signals to the mpu: ce_busy and xfer_busy, which are connected to the mpu interrupt service inputs as external interrupts. ce_busy indica tes that the ce is actively processing data . this signal will occur once every multiplexer cycle . xfer_busy indicates that the ce is updating data to the output region of the ram . this will occur whenever the ce has finished generating a sum by completi ng an accumulation interval determined by sum_cycles[5:0] * pre_samps[1:0] samples . interrupts to the mpu occur on the falling edges of the xfer_busy and ce_busy signals. refer to section 4.3 ce interface description for additional information on setting up the device using the mpu firmware. varsum wsum apulsew apulser ext pulse sag control data dio xfer busy samples ce mpu interrupts i/o ram (configuration ram) mux control adc display (memory mapped lcd segments) serial (uart0/1) eeprom (i 2 c) var (dio7) pulses w (dio6) ce busy figure 27 : mpu/ce communication ce mpu pre - processor post - processor irq processed metering data pulses i/o ram (configuration ram) samples data
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 63 3 a pplication i nformation 3.1 connection of sensors figure 28 through figure 30 show how resistive dividers, current transformers, rogowski coils and res is tive shunts are connected to the voltage and current inputs of the 7 1m6531. the analog input pins of the 71m65xx are designed for sensors with low source impedance. rc filters with resistance values higher than those implemented in the teridian demo boards should be avoided. figure 28 : resisti ve voltage divider figure 29 : ct with single ended (left) and differential input (right) connection figure 30 : resistive shunt (left) and rogowski sensor (right) connection 3.2 connecting 5 - v devices all digital input pins of the 71m6531 d / f and 71m6532d/f are compatible with external 5 - v devices. i/o pins configured as inputs do not require current - limiting resistors when t hey are connected to external 5 v de vices. va = vin * r out /(r out + r in ) v in r in r out va v out r 1/n i in i out filter v3p3 ia inp inn v3p3a v out i out i in r 1/n v diff v out r i in ia v3p3 vout = c* di in / dt v out 1/n i in ian iap v3p3a
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 64 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 3.3 temperature measurement measurem ent of absolute temperature uses the on - chip temperature sensor and applying the following formula: n n n t s n t n t + ? = ) ) ( ( in the above formula , t is the temperature in c, n( t ) is the adc count at temperature t , n n is the adc count at 25c, s n is the sens itivity in lsb/c as stated in the electrical specifications and t n is +25 c . it is recommended that temperature measurements be based on temp_raw_x which is the sum of two consecutive temperature readings , thus being higher by a factor of two than the ra w sensor readings. 3.4 temperature compensation 3.4.1 temperature coefficients: the internal voltage reference vref is calibrated during device manufacture. t he temperature coefficient tc2 is given as a constant that represent s typical com ponent behavior (in v/ c 2 ). tc1 (v/c) can be calculated for the individual chip from the contents of the trimt [7:0] i/o ram register. tc1 and tc2 allow compensation for variations of the reference voltage to within 40 ppm/c. since tc1 and tc2 are given in v/c and v/c 2 , respectively, the value of the vref voltage (1.195v) has to be taken into account when transitioning to ppm/c and ppm/c 2 . this means that ppmc = 26.84*tc1/1.195 and ppmc2 = 1374*tc2/1.195). close examination of the electrical specification (see table 53 ) reveals that the achievable deviation is not strictly 40 ppm/c over the whole temperature range: only for temperatures for which t - 22 > 40 (i.e. t > 62c) or for which t - 22 < - 40 ( i.e. t < - 18c), the data sheet states 40 ppm/c. for temperatures between - 18c and +62c, the error should be considered constant at 1,600 ppm, or 0.16%. p arameter c ondition m in t yp vref(t) deviation from vnom(t) ) 40 , 22 max( 10 ) ( ) ( ) ( 6 ? ? t t vnom t vnom t vref - 40 +40 ppm /oc table 53 : vr ef definition for 6513h figure 31 shows this concept graphically. the ?box? from - 18c to +62c reflects the fact that it is impra c- tical to measure the temperature coefficient of high - quality references at small temperature excurs ions. for example, at +25c, the expected error would be 3c * 40 ppm/c, or just 0.012 %. the maximum deviation of 25 20 ppm (or 0.252%) is reached at the temperature extremes. if the refe r- ence voltage is used to measure both voltage and current, the iden tic al errors of 0.252 % add up to a maximum wh registration error of 0.504 %.
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 65 figure 31 : error band for vref over temperature 3.4.2 temperature compensation for vref the bandgap temperature is used to digitally com pensate the power o utputs for the temperature dependence of vref, using the ce register gain_adj . since the band gap amplifier is chopper - stabilized, the most significant long - term drift mechanism in the voltage reference is removed. the following formula is used to determi ne the gain_adj value of the ce . in this formula , temp_x is the deviation from nominal or calibration temperature expressed in multiples of 0.1 c: 23 2 14 2 2 _ 2 _ 16385 _ ppmc x temp ppmc x temp adj gain ? + ? + = 3.4.3 system temperature compensat i on in a production electricity meter, the 71m6531 or 71 m6532d/f is not the only component contributing to temperature de pendency. a whole range of components (e.g. current transformers, resistor dividers, power sources, filter capacitors) will contribute temperature effects. since the output of the on - chip t emperature sensor is acc essible to the mpu, temperature compensation mechanisms with great flexibility are possible . mpu access to gain_adj permits a system - wide temperature correction over the entire meter rather than local to the chip. 3.4.4 temperature comp ensation for the rtc in order to obtain accurate readings from the rtc, the following procedure is recommended: 1. at the time of meter calibration, the crystal oscillator is calibrated using the rtc a _adj register in i/o ram to be as close to 32768 hz as poss ible . the recommended procedure is to connect a high - precision frequency counter to the tmuxout pin and select 0x11 for tmux[4:0] . this will generate a 4 - second pulse at tmuxout that can be used to trim rtc a _adj to the best value. 2. when the meter is in se rvice, the mpu takes frequent temperature readings . if the temperature cha racteristics of the crystal are known, the temperature readings can be used to modify the settings for the i/o ram registers preg[16:0] and qreg[1:0] in order to keep the crystal fr equency close to 32768 hz. 3. after periods of operation under battery power, the temperature for the time the meter was not powered can be estimated by averaging the temperatures before and after battery operation . based on this, the overall correction for the rtc time can be calculated and applied to the rtc after main power returns to the meter. - 2800 - 2400 - 2000 - 1600 - 1200 - 800 - 400 0 400 800 1200 1600 2000 2400 2800 - 40 - 20 0 20 40 60 80 error band (ppm) over temperature ( c) 40 ppm/ c 40 ppm/ c
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 66 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 3.5 connecting lcds the 71m6531 d / f and 71m6532d/f ha ve an on - chip lcd controller capable of controlling static or multiplexed lcds. figure 32 shows the basic connection for an lcd. the following dedicated and multi - use pins can be assigned as lcd segment pins for the 71m6531d/f : ? 12 dedicated lcd segment pins: seg0 to seg2, seg7, seg8, seg12 to seg18. ? 7 dual - function pins: se g3/pclk, seg4/psdo, seg5/pcsz, seg6/psdi, e_rxtx/seg9, e_tclk/seg10, and e_rst/seg11. ? 14 combined dio and segment pins: seg24/dio4 to seg35/dio15, seg37/dio17, seg48/dio28, seg49/dio29 and seg63/dio43 to seg66/dio46. the following dedicated and multi - use pins can be assigned as lcd segments for the 71m6532d/f : ? 15 dedicated lcd segment pi ns: seg0 to seg2, seg8, seg12 - seg18, seg20 - seg23. ? 9 dua l - function pins: mux_sync/seg7, e_rxtx/seg9, e_tclk/seg10, e_rst/seg11, seg3/pclk, seg4/psdo, seg5/pcsz, seg6/psd i. ? 43 combined dio and segment pins , as described in section 1.5.8 . . figure 32 : connecting lcds 3.6 connecting i 2 c eeproms i 2 c eeproms or other i 2 c compatible devices should be connected to the dio pins dio4 and dio5, as shown in figure 33 . pull - up resistors of roughly 10 k ? to v3p3d (to ensure operation in brownout mode) should be used for both scl and sda signals. the dio_eex[1:0] register in i/o ram must be set to 01 in order to convert the dio pins dio4 and dio5 to i 2 c pins scl and sda. figure 33 : i 2 c eeprom connection dio4 dio5 71m6531d /f 71m6532d/f eeprom scl sda v3p3d 10 k 10 k segments 71m6531d/f or 71m 6532d/f lcd commons
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 67 3.7 connecting three - wire eeproms wire eeproms and other co mpatible devices should be connected to the dio pins dio4 and dio5, as shown in figure 34 and described below: ? dio5 connects to both the di and do pins of the three - wire device. ? the cs pin must be connected to a vacant dio pin of the 71m6531. ? in order to prevent bus contention, a 10 k ? to resistor is used to separate the di and do signals. ? the cs and clk pins should be pulled down with resistors to prevent operation of the three - wire device on power - up, before t he 71m6531 can establish a stable signal for cs and clk . ? the dio_eex[1:0] register in i/o ram must be set to 2 (b 10 ) in order to convert the dio pins dio4 and dio5 to wire pins. the - wire eeprom interface is only functional when mpu_div[2:0] = 000. figure 34 : three - wire eeprom connection 3.8 uart0 (tx/rx) the uart0 rx pin should be pulled down by a 10 k ? resistor and additionally protected by a 100 pf ceram ic capacitor, as shown in figure 35 . figure 35 : connections for uart0 3.9 optical interface (uart1) the opt_tx and opt_rx pins can be used for a regular serial interface ( by connecting a rs - 232 tran scei ver for example) , or they can be used to directly operate optical components (for example, an infrared diode and phototransistor implementing a flag interface ) . figure 36 shows the basic connections for uart1 . th e opt_tx pin becomes active when the i/o ram register opt_txe is set to 0 0. tx rx 71m6531d/f, 71m 6532d/f 10 k 100 pf rx tx 71m653x eeprom 100 k ? dio4 dio5 clk di v3p3d 100 k ? cs dion do 10 k ? vcc
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 68 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 the polarity of the opt_tx and opt_rx pins can be inverted with the configuration bits , opt_txinv and opt_rxinv , re spectively . the opt_tx output may be modulated at 38 khz when system power is present . modulation is not available in brownout mode . the opt_txmod bit enables modulation . the duty cycle is controlled by opt_fdc[1:0] , which can select 50%, 25%, 12.5% and 6.25% duty cycle . a 6.25% duty cycle means opt_tx is low for 6.25% of the period. the opt_rx pin uses digital signal thresholds. it may need an analog filter when receiving modulated optical signals. with modulation, an optical emitter can be operated at higher current than nominal, enabling it to increase the distance along the optical path. if operation in brownout mode is desired, the external co mponents should be connected to v3p3d. figure 36 : connection for optical components 3.10 connecting the v1 pin a v oltage divider should be used to establish that v1 is in a safe range when the meter is in mission mode (see figure 37 ) . v1 must be lower than 2.9 v in all cases in order to keep the hardware watchdog timer enable d . the resistor divider ratio must be chosen so that v1 crosses the vbias threshold when v3p3 is near the minimum supply voltage (3.0 vdc). a series r esistor (r3) provides additional hysteresis, and a capacitor to ground (c1) is added for enhanced emc im munity . the amount of hysteresis depends on the choice of r1 and r3: if v1 < vbias, approximately 1 a will flow into the on - chip v1 comparator causing a voltage drop. if v1 vbias, almost no current will flow into the comparator. the voltage drop will require v3p3 to be slightly higher for v1 to cross the vbias threshold when v3p3 is rising as compared to when v3p3 is falling. maintaining sufficient hysteresis helps to eli minate rapid mode changes which may occur in cases where the power supply is unstable with v1 close to the vbias threshold point. figure 37 : voltage divider for v1 v3p3 r 2 v1 r 1 r 3 c 1 100pf gnd 16.9k 20k opt_tx r 2 r 1 opt_rx 71m6531d/f or 71m 6532d/f v3p3sys phototransistor led 1 0 k ? 100 pf v3p3sys
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 69 r 1 reset 71m6533 dgnd 100 r 1 reset 71m6533 dgnd 100 3.11 connecting the reset pin even though a functional meter will not necessarily need a reset switch, it is useful to have a reset push - button for prototyping as shown in figure 38 , left side. the reset signal may be sourced from v3p3sys (functional in mission mode only), v3p3d (mi ssion and brownout modes), or vbat (all modes, if a battery is present), or from a combination of these sources, depending on the application. for a production meter, the reset pin should be protected by the by the external components shown in figure 38 , right side. r1 should be in the range of 100 ? and mounted as closely as possible to the ic. figure 38 : external components for the reset pin: push - button (left), production circuit (right) since the 71m6531 generates its own power - on reset, a reset button or circuitry, as shown in figure 38 , is only required for test units and prototypes. 3.12 connecting the emulator port pins even when the emulator is not used, small shunt capacitors to ground (22 pf) should be used for protection from emi as illustrated in figure 39 . production boards should have the ice_e pin connected to ground. figure 39 : external components for the emulator interface 3.13 connecting a battery it is important that a valid voltage is connected to the vbat pin at all times. for meters without a battery, vb at should be connected directly to v3p3sys. designs for meters with batteries need to ensure that the meter functions even when the battery voltage decreases below the specified voltage for vbat. this can be achieved by connecting a diode from v3p3sys to vbat. however, the battery test will yield in accurate results if that technique is used, since the voltage at v3p3sys will feed current to the vbat pin. a better solution is shown in figure 40 : during the battery test, a dio p in is activated as an output and applies a low voltage to the anode of the diode. this prevents the voltage at the power supply to i n- fluence the voltage at the vbat pin. e_rst 71m6531d/f 71m 6532d/f e_tclk 62 62 ? 62 ? 22 pf 22 pf 22 pf lcd segments ice_e v3p3d e_rxt (optional) r 1 reset gndd v3p3d r 2 vbat/ v3p3d reset switch 1k ? 0.1f 10k ? 71m6531d/f 71m6532d/f 71m6531 d/f 71m 6532d/f
data sheet 71m6531d/f - 71m6532d/f fd s 6531/6532 005 70 ? 2005 - 201 0 teri dian semiconductor corporation v1.3 figure 40 : connecting a battery as mentioned in section 2.3 , meters equipped with batteries need to contain code that transitions the chip to sleep mode as soon as the battery is attached in production. otherwise, remaining in brownout mode would add unnecessary drain to the batter y. 3.14 flash programming operational or test code can be programmed into the flash memory using either an in - circuit emulator or th e flash programmer module (tfp2 ) available from teridian. the flash programming procedure uses the e_rst, e_rxtx and e_tclk pin s. the fl_bank[2:0] register must be set to the value corresponding to the bank that is being programmed. 3.15 mpu firmware all application - specific mpu functions mentioned in the application information section are featured in the demonstration source code supplied by teridian. the code is available as part of the demonstration kit for the 71m6531 d / f and 71m6532d/f . the demonstration kits come with the 71m6531 d / f or 71m6532d/f pre programmed with demo firmware and mounted on a functional sample meter demo board. the demo boards allow for quick and efficient evaluation of the ic without having to write firmware or having to supply an in - circuit emulator (ice). 3.16 crystal oscillator the oscillator drives a standard 32. 768 khz watch crystal . the oscillator has been designed specifically to handle these crystals and is compatible with their high impedance and limited power handling capability . the oscillator power dissipation is very low to maximize the lifetime of any battery backup device attached to vbat. board layouts with minimum capacitance from xin to xout will require less battery current . good layouts will have xin and xout shielded from each other. for best rejection of electromagnetic interference, connect the crystal body and the ground ter minals of the two crystal capacitors to gndd through a ferrite bead. no external resistor should be connected across the crystal, since the oscillator is self - biasing. 71m6531/71m6532 v3p3a dio power supply v3p3sys vb at battery or super - cap + -
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f v1.3 ? 2005 - 2010 teri dian semiconductor corporation 71 3.17 meter calibration once the teridian 71m6531 d / f or 7 1m6532d/f energy meter device has been installed in a meter system, it must be calibrated . a complete calibration includes the following: ? calibration of the metrology section, i.e. calibration for tolerances of the current sensors, voltage dividers and si gnal conditioning components as well as of the internal reference voltage (vref). ? establishment of the reference temperature ( section 3.3 ) for temperature measurement and temperature compensation ( section 3.4 ) . ? calibration of the battery voltage measurement ( section 1.5.13 ) . ? calibration of the oscillator frequency ( section 1.5.3 ) and tempe rature compensation for the rtc ( section 3.4.4 ). the metrology section can be calibrated using the gain and phase adjustment factors accessible to the ce . the gain adjust ment is used to compensate fo r tolerances of components used for signal conditioning, especially the resistive components . phase adjustment is provided to compensate for phase shifts introduced by the current sensors or by the effects of reactive power supplies . due to the flexibilit y of the mpu firmware, any calibration method, such as calibration based on energy, or current and voltage can be implemented . it is also possible to implement segment - wise calibration (depending on current range). the 71m6531 d / f and 71m6532d/f support co mmon industry standard calibration techniques, such as single - point (energy - only) , multi - point (energy, vrms, irms) and auto - calibration.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 72 ? 2005 - 2010 teri dian semiconductor corporation v1.3 4 f irmware i nterface 4.1 i/o ram and sfr map ? functional order in table 54 , unimplemented (u) a nd reserved (r) bits are shaded in light gray. unimplemented bits have no memory storage, writing them has no effect, and reading them always returns zero. reserved bits may be in use and should not be changed from the values given in parentheses. writi ng values other than those shown in parenthesis to reserved bits may have undesir able side effects and must be avoided. non - volatile bits are shaded in dark gray. non - volatile bits are backed - up during power failures if the system includes a battery conn ected to the vbat pin. this table lists only the sfr registers that are not ge neric 8051 sfr registers. bits marked with ? apply to the 71m6531d/f only, bits marked with ? apply to the 71m6532d/f only and should be 0 for the other device. table 54 : i/o ram map in functional order name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 configuration: ce0 2000 equ[2:0] ce_e ce10mhz u ce1 2001 pre_samps[1:0] sum_cycles[5:0] ce2 2002 u chop_e[1:0] rtm_e wd_ovf ex_rtc ex_xfr co mp0 2003 u pll_ok u u u u u comp_stat config0 2004 vref_cal pls_inv u ckout_e vref_dis mpu_div[2:0] config1 2005 u u eck_dis m26mhz adc_e mux_alt u m40mhz version 2006 version[7:0] config2 2007 opt_txe[1:0] ex_pll ex_fwcol fir_len[1:0] opt_fdc[1:0] ce 3 209d u mux_div[3:0] ce4 20a7 boot_size[7:0] ce5 20a8 ce_lctn[7:0] wake 20a9 wake_arm sleep lcd_only u wake_res wake_prd[2:0] tmux 20aa u tmux[4:0] anactrl 20ab r (0000) lcd_dac[2:0] chop_i_en ? config3 20ac u sel_ib n ? chop_ib ? u sel_ian ? chop_ia ? c onfig4 20ad u r ( 0 ) r ( 0 ) u r ( 0 ) r ( 0 ) interrupts and wd timer : intbits sfr f8 wd_rst int6 int5 int4 int3 int2 int1 int0 iflags sfr e8 ie_pllfall ie_pllrise ie_wake ie_pb ie_fwcol1 ie_fwcol0 ie_rtc ie_xfer flash memory: erase sfr 94 flsh_erase[7:0] flshctl sfr b2 preboot secure wrprot_bt wrprot_ce u flsh_meen flsh_pwe fl_bank sfr b6 u flbank[2:0] pgadr sfr b7 flsh_pgadr[5:0] u
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 73 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 digital i/o: 20af u dio_rrx[2:0] dio0 2008 dio_eex[1:0] opt_rxdis opt_rxinv dio_pw dio_pv opt_txmod opt_txinv dio1 2009 u dio_r1[2:0] ? u di_rpb[2:0] dio2 200a u u u dio_r2[2:0] dio3 200b u dio_r5[2:0] u dio_r4[2:0] dio4 200c u dio_r7[2:0] u dio_r6[2:0] dio5 200d u dio_r9[2:0] u dio_r8[2:0] dio6 200e u dio_r11[2:0] u dio_r10[2:0] 200f r (0) r (0) u dio_px dio_py u d io7 sfr 80 dio_0[7: 1 ] dio_0[0]? dio8 sfr a2 dio_dir0[7:1] dio_dir0[0]? dio9 sfr 90 dio_1[7:0] (port 1) dio10 sfr 91 dio_dir1[7:0] dio11 sfr a0 dio_2[7 ] ? dio_2[ 6 ] ? dio_2[5] ? dio_2[4] ? dio_2[3] ? dio_2[2 ] ? dio_2[1] dio_2[0 ] ? dio12 sfr a1 dio_dir2[7 ] ? dio_dir2[6] ? dio_dir2[5] ? dio_dir2[4] ? dio_dir2[3] ? dio_dir2[2 ] ? dio_dir2[ 1] dio_dir2[0 ] ? dio13 sfr b0 r (0) dio_3[6 ] ? dio_3[5 ] dio_3[ 4] ? dio_3[3 ] ? dio_3[2 ] ? dio_3[1 ] ? dio_3[0 ] ? real time clock: rtcctrl 2010 u rst_subsec rtca_adj 2011 u rtca_ adj[6:0] subsec1 2014 subsec[7:0] rtc0 2015 u rtc_sec[5:0] rtc1 2016 u rtc_min[5:0] rtc2 2017 u rtc_hr[4:0] rtc3 2018 u rtc_day[2:0] rtc4 2019 u rtc_date[2:0] rtc5 201a u rtc_mo[3:0] rtc6 201b rtc_yr[7:0] rtcadj_h 201c u preg[16:14] rtcadj_m 201d preg[13:6] rtcadj_l 201e preg[5:0] qreg[1:0] we 201f rtc write protect register
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 74 ? 2005 - 2010 teri dian semiconductor corporation v1.3 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lcd display interface: lcdx 2020 mux_sync_e bme r (0) r (0) u lcdy 2021 u lcd_y lcd_e lcd_mode[2:0] lcd_clk[1:0] lcd_map0 2023 lcd_bitmap[31:24] lcd_map1 2024 lcd_bitma p [39] ? lcd_bitmap [38 ] ? lcd_bitmap [37 ] lcd_bitmap [36 ] ? lcd_bitmap [35 ] lcd_bitmap [34 ] lcd_bitmap [33 ] lcd_bitmap [32 ] lcd_map2 2025 lcd_bitmap[47:40] ? lcd_map3 2026 u lcd_bitmap [50] ? lcd_bitmap [49 ] lcd_bitmap [48 ] ? lcd_map4 2027 lcd_bitmap [ 6 3 ] lc d_bitmap [ 6 2 ] ? lcd_bitmap [ 6 1 ] ? lcd_bitmap [ 6 0 ] ? u lcd_map5 2028 lcd_bitmap [71 ] ? lcd_bitmap [70 ] ? lcd_bitmap [69 ] ? lcd_bitmap [68 ] ? lcd_bitmap [67 ] ? lcd_bitmap [66 ] ? lcd_bitmap [65 ] lcd_bitmap [64 ] lcd_map6 2029 u lcd0 2030 lcd_seg 42 [3:0] ? lcd_seg0[3:0 ] lcd1 2031 lcd_seg 43 [3:0] ? lcd_seg1 [3:0] lcd2 2032 u lcd_seg2 [3:0] lcd3 2033 lcd_seg 45 [3:0] ? lcd_seg3 [3:0] lcd4 2034 lcd_seg 46 [3:0] ? lcd_seg4 [3:0] lcd5 2035 lcd_seg 47 [3:0] ? lcd_seg5 [3:0] lcd6 2036 lcd_seg48[3:0] ? lcd_seg6 [3:0] ? lcd7 2037 lcd_seg49[ 3:0] lcd_seg7 [3:0] lcd8 2038 lcd_seg50 [3:0] ? lcd_seg8[3:0] lcd9 2039 u lcd_seg9[3:0] ? ? ? ? lcd17 2041 u lcd_seg17 [3:0] lcd18 2042 lcd_seg60 [3:0] ? lcd_seg18 [3:0] lcd19 2043 lcd_seg61 [3:0] ? lcd_seg19[3:0] lcd20 2044 lcd_seg62 [3:0] ? lcd_seg20 [3:0] ? lcd21 2045 lcd_seg63[3:0] lcd_seg21 [3:0] ? lcd22 2046 lcd_seg64[3:0] lcd_seg22 [3:0] ? lcd23 2047 lcd_seg65[3:0] lcd_seg23 [3:0] ? lcd24 2048 lcd_seg66[3:0] ? lcd_seg24[3:0] lcd25 2049 lcd_seg6 7 [3:0] ? lcd_se g25[ 3:0] lcd26 204a lcd_seg68 [3:0] ? lcd_seg26[ 3:0]
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 75 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lcd27 204b lcd_seg69 [3:0] ? lcd_seg27[ 3:0] ? lcd28 204c lcd_seg70 [3:0] ? lcd_seg28[ 3:0] lcd29 204d lcd_seg71 [3:0] ? lcd_seg29[ 3:0] lcd30 204e u lcd_seg30[ 3:0] ? ? ? ? lcd33 2053 u lcd_seg3 5 [3:0] lcd36 2054 u lcd_seg3 6 [3:0] ? lcd37 2055 u lcd_seg37[3:0] lcd38 2056 u lcd_seg38 [3:0] ? ? ? ? ? lcd41 2059 u lcd_seg41 [3:0] ? lcd_blnk 205a lcd_blkmap19[3:0] lcd_blkmap18[3:0] rtm: rtm0h 2060 u rtm0[9:8] rtm0l 2061 rtm0[7:0] rtm1h 2062 u rtm1 [9:8] rtm1l 2063 rtm 1 [7:0] rtm2h 2064 u rtm2 [9:8] rtm2l 2065 rtm 2 [7:0] rtm3h 2066 u rtm 3 [9:8] rtm3l 2067 rtm3 [7:0] spi interface: spi? 2070 spe u sp_cmd 2071 sp_cmd[7:0] sp_adh 2072 sp_addr[15:8] sp_adl 2073 sp_addr[7:0] pulse generator: pls_w 2080 pls_maxwidth[7:0] pls_i 2081 pls_interval[7:0] adc mux: s lot0 2090 slot1_sel slot0_sel slot1 2091 slot3_sel slot2_sel slot2 2092 r r slot3 2093 r r slot4 2094 r r
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 76 ? 2005 - 2010 teri dian semiconductor corporation v1.3 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 slot5 2096 slot1_altsel slot0_altsel slot6 2097 slot3_altsel slot2_altsel slot7 2098 r r slot8 2099 r r slot9 209a r r spi interrupt: spi0 20b0 u ien_spi u ien_wd_nrovf spi1 20b1 u spi_flag u wd_nrovf_flag general - purpose nonvolatile registers: gp0 20c0 gpo[7:0] ? ? ? gp7 20c7 gp7[7:0] version 20c8 version[7:0] serial eeprom: eedata sfr 9e eedata[7:0] eectrl sfr 9f eectrl[7:0] ? 71m 6531d/f only ? 71m6532d/f only
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 77 4.2 i/o ram d escription ? alphabetical order the following conventions apply to the descriptions in this table: ? bits with a w (write) direction are written by the mpu into configuration ram . typically, they are initially stor ed in flash memory and copied to the configuration ram by the mpu . some of the more frequently programmed bits are mapped to the mpu sfr memory space . the remaining bits are mapped to 2xxx . ? bits with a r (read) direction can be read by the mpu . ? colum ns labeled reset and wake describe the bit values upon reset and wake, respectively . ? n v? in the wake column means the bit is powered by the nonvolatile supply and is not initialized . lcd - related registers labeled ?l? retain data upon transition from lcd mode to brown out mode and vice versa, but d o not retain data in sleep mode. ? ? ? means that the value is undefined. ? write - only bits will return zero when they are read. table 55 : i/o ram description - alphabetical name location re set wake dir description adc_e 2005[3] 0 0 r/w enables adc and vref . when disabled, removes bias current . bme 2020[6] 0 ? r/w battery measure enable . when set, a load current is immediately applied to the battery and it is connected to the adc to be me asured on alternative mux cycles . see the mux_alt bit. boot_size[7:0] 20a7[7:0] 01 01 r/w end of space r eserved for boot program . the ending address of the boot region is 1024* boot_size . ce10mhz 2000[3] 0 0 r/w ce clock select . when set, the ce is clo cked at 10 mhz . otherwise, the ce clock frequency is 5 mhz. ce_e 2000[4] 0 0 r/w ce enable. ce_lctn[7 :0] 20a8[4:0] 31 31 r/w ce program location . the starting address for the ce program is 1024* ce_lctn . chop_e[1:0] 2002[5:4] 0 0 r/w chop enable for th e reference bandgap circuit . the value of chop will change on the rising edge of muxsync according to the value in chop_e[1:0] : 00 = toggle , except at the mux sync edge at the end of sumcycle , an alternative mux frame is automatically inserted at the end of each accumulation interval. 01 = positive . 10 = reversed . 11 = toggle , no alternative mux frame is inserted chop_ia 20ac[0] 0 0 r/w th is bit enable s chop mode for the ia current channel (71m6532d/f only) . chop_i_e must be set also. chop_i b 20 ac[4 ] 0 0 r/w th is bit enable s chop mode for the ib current channel ( 71m6532d/f only) . chop_i_e must be set also. chop_i_e 20ab [0] 0 0 r/w th is bit must be set to enable chop mode for the current channel s ( 71m6532d/f only) . ck out_e 2004[4 ] 0 0 r /w contr o l bit for the seg19/ckout pin: 0: the pin is the seg19 lcd driver 1: the pin is the ck_fir output (5 mhz in mission mode, 32 khz in brownout mode)
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 78 ? 2005 - 2010 teri dian semiconductor corporation v1.3 name location re set wake dir description comp_stat[0] 2003[0] ? ? r status bit for the v1 comparator (same as v1_ok, see tmuxout) di_rpb[2:0] dio_r 1[2:0] dio_r2[2:0] dio_r4 [2:0] dio_r5[2:0] dio_r6[2:0] dio_r7[2:0] dio_r8[2:0] dio_r9[2:0] dio_r10[2:0] dio_r11[2:0] dio_rrx[2:0] 2009[2:0] 2009[6:4] 200a[2:0] 200b[2:0] 200b[6:4] 200c[2:0] 200c[6:4] 200d[2:0] 200d[6:4] 200e[2:0] 200e[6:4] 20af[2:0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 r/w connects dedicated i/o pins dio2 and dio4 through dio11 as well as input pins pb, dio1 and rx to internal resources. if more than one input is conne cted to the same resource, the m ultiple column in the table b elow specifies how they are combined. dio_rx [2:0] resource m ultiple 000 none ? 001 reserved or 010 t0 ( counter / timer 0 clock or gate) or 011 t1 ( counter / timer 1 clock or gate) or 100 high priority io interrupt (int0 rising) or 101 low priority io i nterrupt (int1 rising) or 110 high priority io interrupt (int0 fal l- ing) or 111 low priority io interrupt (int1 falling) or dio_dir0[7:1] sfr a2 [7:1] 0 ? r/w programs the direction of dio pins 7 through 1. 1 indicates an output. the bits are ignored if the pin is not configured as dio. see dio_pv and dio_pw for special options for dio6 and dio7. see dio_eex[1:0] for special options for dio4 and dio5. dio_dir1[7:0] sfr 91 0 ? r/w programs the direction of dio pins 15 through 8. 1 indicates an outp ut. the bits are ignored if the pin is not configured as i/o. see dio_px and dio_pw for special options for the dio8 and dio9 outputs. dio_dir2[1] sfr a1 [1] 0 ? r/w programs the direction of dio17. dio_0[7:0] dio_1[7:0] dio_2[1] dio_3[5:4] sfr 80 sfr 9 0 sfr a0[1] sfr b0[5:4] 0 0 0 0 ? ? ? ? r/w r/w r/w r/w the value on the dio pins. pins configured as lcd will read zero. when written, changes data on pins configured as outputs. pins configured as lcd or input will ignore writes. dio_0[7:1] corresponds to dio7 through dio1 . pb is read on dio_0[0] . dio_1[7:0] corresponds to dio15 through dio8. dio_2[1] corresponds to dio17. dio_3[5:4] corresponds to dio28 and dio29 . dio_eex[1:0] 2008[7:6] 0 0 r/w when set, converts dio4 and dio5 to interface with external eeprom. dio4 becom es sdck and dio5 becomes bi - directional sdata. dio_eex[1:0] function 00 disable eeprom interface 01 2 - wire eeprom interface 10 3 - wire eeprom interface 11 not used
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 79 name location re set wake dir description dio_pv 2008[2] 0 0 r/w causes varpulse to be output on dio7. dio_pw 2008[3] 0 0 r/w causes wpulse to be output on dio6. dio_px 200f[3] 0 0 r/w causes xpulse to be output on dio8 . dio_py 200f[2] 0 0 r/w causes ypulse to be output on dio9 . eedata[7:0] sfr 9e 0 0 r/w serial eeprom interface data . eectrl[7:0] sfr 9f 0 0 r/w serial eeprom interface control . eck_dis 2005[5] 0 0 r/w emulator clock disable. when eck_dis = 1 , the emulator clock is disabled. if eck_dis is set, the emulator and programming devices will be unable to erase or program the device. equ[2:0] 2000[7:5] 0 0 r/w spec ifies the power equation to be used by the ce. ex_xfr ex_rtc ex_fwcol ex_pll 2002[0] 2002[1] 2007[4] 2007[5] 0 0 0 0 0 0 0 0 r/w interrupt enable bits. these bits enable the xfer_busy, the rtc_1sec, the fir m- warecollision (fwcol) and pll interrupts. note that if one of these interrupts is to be enabled, its corresponding mpu ex enable must also be set. see section 1.4.9 interrupts for details. fir_len[1:0] 2007[3:2] 1 1 r/w fir_len [1:0] controls the length of the adc decimation fir filter and therefore controls the time taken for each conversion . [ m40mhz, m26mhz ] fir_len[1:0] resulting fir filter cycles resulting ck32 cycles resulting dc gain [00], [10], or [11] 00 138 1 0.110017 01 288 2 1.000 10 384 3 2.37037 [01] 00 186 1 0.113644 01 384 2 1.000 10 588 3 3.590363 fl_bank[2:0] sfr b6[ 2 :0] 1 1 r/w flash bank. m emory above 32 kb is mapped to the mpu address space from 0x8000 to 0xffff in 32 kb banks. wh en mpu address[15] = 1, the address in flash is mapped to fl_bank[2:0], mpu address[14:0]. fl_bank is reset by the erase cycle.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 80 ? 2005 - 2010 teri dian semiconductor corporation v1.3 name location re set wake dir description flsh_erase [7:0] sfr 94[7:0] 0 0 w flash erase initiate . (default = 0x00) . flsh_erase is used to initiate either the flash mass erase cycle or the flash page erase cycle. specific patterns are expected for flsh_erase in order to initiate the appropriate erase cycle. 0x55 = i nitiate flash page erase cycle. must be proceeded by a write to flsh_pgadr [5:0] @ sfr 0xb7. 0xaa = initiate flash mass erase cycle. must be proceeded by a write to flsh_meen @ sfr 0xb2 and the debug (cc) port must be enabled. any other pattern written to flsh_erase will have no effect. the erase cycle is not completed until 0x00 is written to flsh_er ase . flsh_meen sfr b2[1] 0 0 w mass erase enable . 0 = mass erase disabled (default). 1 = mass erase enabled. must be re - written for each new mass erase cycle. flsh_pgadr [5:0] sfr b7 [7:2] 0 0 w flash page erase address . (d efault = 0x00) flsh_pgadr [5: 0] with fl_bank [2:0], sets the flash page address (page 0 through 127) that will be erased during the page erase cycle . must be re - written for each new page erase cycle . flsh_pwe sfr b2[0] 0 0 r/w program write enable . this bit must be cleared by the m pu after each byte write o p- eration. write operations to this bit are inhibited when interrupts are enabled. 0 = movx commands refer to xram space, normal operation (default). 1 = movx @dptr,a moves a to program space (flash) @ dptr. gp0 ? gp7 20c0 ? 20c7 0 ? 0 nv ? nv r/w non - volatile general - purpose registers powered by the rtc supply. these registers maintain their value in all power modes, but will be cleared on reset. the values of gp0?gp7 will be undefined if vbat drops below the minimum value. ie _fwcol0 ie_fwcol1 sfr e8[2] sfr e8[3] 0 0 0 0 r/w r/w interrupt flags for firmware collision interrupt. see the flash memory section for de tails. ie_pb sfr e8[4] 0 ? r/w pb flag. indicates that a rising edge occ urred on pb. firmware must write a zero to this bit to clear it. the bit is also cleared when the mpu re quests sleep or lcd mode. on bootup, the mpu can read this bit to determine if the part was woken with the pb ( dio0[0] ) . ie_pllrise sfr e8[6] 0 0 r /w indicates that the m pu was woken or interrupted (int4) by s ystem power becoming available, or more precisely, by pll_ok rising. the f irmware must write a zero to this bit to clear it . ie_pllfall sfr e8[7] 0 0 r/w indicates that the mpu has entered bro wnout mode because s ystem pow er has become unavailable (int4 ), or more precisely, because pll_ok fell. t his bit will not be set if the part wakes into brownout mode because of pb or the wake timer. the f irmware must write a zero to this bit to clear it. ien_spi 20b0[4] 0 ? r/w spi interrupt enable.
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 81 name location re set wake dir description ien_wd_nrovf 20b0[0] 0 0 r/w active high watchdog near overflow interrupt enable. ie_xfer ie_rtc sfr e8[0] sfr e8[1] 0 0 0 0 r/w interrupt flags. these flags monitor the xfer_busy interrupt and the rtc_1sec interrupt. the flags are set by hardware and clear auto matically . ie_wake sfr e8[5] 0 ? r/w indicates that the mpu was awakened by the autowake timer. this bit is typically read by the mpu on bootup. the f irmware must write a zero to this bit to clear it . intbits sfr f8[6:0] ? ? r/w interrupt inputs. the mpu may read these bits to see the status of external interrupts int0, int1 up to int6. these bits do not have any memory and are primarily intended for debug use. lcd_bitmap [31:24] 2023 0 l r/w c onfiguration for dio11/seg31 through dio4/seg24. unused bits should be set to zero. 1 = lcd pin, 0 = dio pin. check table 54 for bit availability. lcd_bitmap [39 :32] 2024 0 l r/w bitmap of d io19/seg39 through dio 12/seg32. unused bits should be set to zero. 1 = lcd pin, 0 = dio pin. check table 54 for bit availability. lcd_bitmap [55 :48] 2026 0 l r/w bitmap of dio28/seg48 through dio35/seg55 . unused bits should be set to zero. 1 = lcd pin, 0 = dio pin. check table 54 for bit availability. lcd_bitmap [63 :56 ] 2027 0 l r/w bitmap of dio36/seg56 through dio43/seg63 . unused bits should be set to zero. 1 = lcd pin, 0 = dio pin. check table 54 for bit availability. lcd_bitmap [71 :64] 2028 0 l r/w bitmap of d io44/seg64 through dio51/seg71 . unused bits should be set to zero. 1 = lcd pin, 0 = dio pin. check table 54 for bit availability. lcd_blkmap19 [3:0] lcd_blkmap18 [3:0] 205a[7:4] 205a[3:0] 0 l r/w identifies which segments connected to seg18 an d seg19 should blink. 1 means blink. the m ost sign ificant bit corresponds to com3, the l east significant bi t to com0. lcd_clk[1:0] 2021[1:0] 0 l r/w sets the lcd clock frequency for com/seg pins ( not 00 = f w /2 9 frame rate) according to the fol lowing ( f w = 32768 hz ): 01 = f w/ 2 8 10 = f w /2 7 11 = f w /2 6
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 82 ? 2005 - 2010 teri dian semiconductor corporation v1.3 name location re set wake dir description lcd_dac[2:0] 20ab[3:1] 0 l r/w lcd contrast control dac. ad justs the lcd voltage in steps of 0.2 v from v3p3sys (mission mode) or vbat (brownout/lcd modes). lcd_dac[2:0] resulting lcd voltage 000 v3p3 or vbat 001 v3p3 or vbat ? 0.2v 010 v3p3 or vbat ? 0.4v 011 v3p3 or vbat ? 0.6v 100 v3p3 or vbat ? 0.8v 101 v3p3 or vbat ? 1.0v 110 v3p3 or vbat ? 1.2v 111 v3p3 or vbat ? 1.4v lcd_e 2021[5] 0 l r/w enables the lcd disp lay. when disabled, vlc2, vlc1 and vlc0 are ground as are the com and seg outputs. lcd_mode[2:0] 2021[4:2] 0 l r/w the lcd bias mode. use the lcd dac in anactrl to reduce saturation. the number of states is the number of commons which are driven to multiplex the lcd. lcd_mode[2:0] function notes 000 4 states, ? bias ? bias modes can drive 3.3 v lcds. 0 0 1 3 states, ? bias 0 10 2 state s, ? bias ? bias and static modes can drive both 3.3 v and 5 v lcds. 0 11 3 states, ? bias 100 static display lcd_only 20a9[5] 0 0 w puts the part to sleep, but with the lcd display still active. lcd_only is i gnored if system power is present. whil e in sleep mode , t he device will wake up on reset, when the auto wake timer times out, when the push button is pushed, or when system power returns. lcd_seg0[3:0] ? lcd_seg19[3:0] 2030[3:0] ? 2043[3:0] 0 ? 0 l ? l r/w ? r/w lcd segment data. each word con tains information for 1 to 4 time divisions of each segment. some addresses are used to address two segments. in each word, bit 0 corresponds to com0, bit 1 to com1, bit 2 to com2 and bit 3 to com3 of the first segment. b it s 4 through 7 correspond to com0 to com3, respe c- tively, of the second segment. care should be taken when writing to lcd_seg locations since some of them control dio pins. lcd_seg24[3:0] ? lcd_seg3 1 [3:0] 2048[3:0] ? 204f[3:0] 0 ? 0 l ? l r/w ? r/w lcd_seg32 [3:0] 2050[3:0] 0 l r/ w
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 83 name location re set wake dir description lcd_seg33 [3:0] ? lcd_seg35 [3:0] 20 51[3:0] ? 2053[3:0 ] 0 ? 0 l ? l r/w ? r/w lcd_seg37 [3:0] 2055[3:0] 0 l r/w lcd_seg 39 [3:0] ? lcd_seg41 [3:0] 2057[3:0] ? 2059[3:0 ] 0 ? 0 l ? l r/w ? r/w lcd_seg48[7:4] ? lcd_seg49[7:4] 2036[7:4] ? 2037[7:4] 0 ? 0 l ? l r/w ? r/w lcd_seg 63[7:4] ? lcd_ seg66 [7:4] 2045[7:4] ? 2048[7:4] 0 ? 0 l ? l r/w ? r/w lcd_seg71[7:4] ? lcd_seg73 [7:4] 204d[7:4] ? 204f[7:4] 0 ? 0 l ? l r/w ? r/w lcd_y 2021[6] 0 l r/w lcd blink frequency (ignored if blink is disabled or if the segment is off). 0 = 1 hz (500 ms on, 500 ms off) 1 = 0.5 hz (1 s on, 1 s off) m26mhz m40mhz 2005[4] 2005[0] 0 0 0 0 r/w r/w m26mhz and m40mhz set the master clock (mck) frequency. the se bits are reset on chip reset and may only be set. attempts to write zeroes to m40mhz and m26mhz . are ignored. mpu_div[2:0] 2004[2:0] 0 0 r/w the mpu clock divider (from mck) . these bits may be programmed by mpu without risk of losing control. mpu_div[2:0] resulting clock f requency 000 mck/2 2 001 mck/2 3 010 mck/2 4 011 mck/2 5 100 mck/2 6 101 mck/2 7 110 mck/2 8 111 mck/2 8
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 84 ? 2005 - 2010 teri dian semiconductor corporation v1.3 name location re set wake dir description mux_alt 2005[2] 0 0 r/w the mpu asserts this bit when it wishes the mux to perform adc conversions on an alternate set of inputs. if chop_e[1:0] is 00, mux_alt is automatically asserted once per sumcycle, when xfer_busy falls. mu x_div[3:0] 209d[ 3:0 ] 0 0 r/w the number of states in the input multiplexer. mux_sync_e 2020[7] 0 0 r/w when set, seg7 outputs mux_sync. otherwise, seg7 is an lcd pin. opt_fdc[1:0] 2007[1:0] 0 0 r/w selects the modulation duty cycle for opt_tx . opt_fdc[1 :0] function 00 50% low 01 25% low 10 12.5% low 11 6.25% low opt_rxdis 2008[5] 0 0 r/w configures opt_rx to an analog input to the optical uart comparator or as a digital in put/output, dio1: 0 = opt_rx, 1 = dio1. opt_rxinv 2008[4] 0 0 r/w inverts t he result from the opt_rx comparator when 1. affects only the uart input. has no effect when opt_rx is used as a dio input. opt_txe[1:0] 2007[7: 6] 00 00 r/w configures the opt_tx output pin. opt_txe[1:0] function 00 opt_tx 01 dio2 10 wpulse 11 rpuls e opt_txinv 2008[0] 0 0 r/w invert s opt_tx when 1. this inversion occurs before modulation. opt_txmod 2008[1] 0 0 r/w enables modulation of opt_tx. when opt_txmod is set, opt_tx is modulated when it would otherwise have been zero. the modulation is applied after any inversion caused by opt_txinv . pll_ok 2003[6] 0 0 r indicates that system power is present and the clock generation pll is settled. pls_maxwidth [7:0] 2080[7:0] ff ff r/w determines the maximum width of the pulse (low going pulse). th e m aximum pulse width is (2*pls_maxwidth + 1)*t i . where t i is pls_interval . if pls_interval = 0, t i is the sample time (397 s). if set to 255, pulse width control is disable d and pulses are output with a 50% duty cycle. pls_interval [7:0] 2081[7:0] 0 0 r/w for pulse_w and pulse_v only: i f the fifo is used, pls_interval must be set to 81 . if pls_interval = 0, the fifo is not used and pulses are output as soon as the ce issues them.
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 85 name location re set wake dir description pls_inv 2004[6] 0 0 r/w inverts the polarity of the pulse outputs. no rmally, these pulses are active low. when inverted, they become active high. preboot sfrb2[7] ? ? r indicates that the preboot sequence is active. preg[16:0] 201c[2:0] 201d[7:0] 201e[7:2] 4 0 0 4 0 0 r/w r/w r/w rtc adjust. see section 1.5.3 real - time clock (rtc) for additional details . 0x0ffbf preg [16:0] 0x10040 preg[16:0] and qreg[1:0] are separate in hardware but can be programmed with a single number calculate d by the mpu. pre_samps[1:0] 2001[7:6] 0 0 r/w the duration of the pre - summer, in samples. pre_samps[1:0] pre - summer duration 00 42 01 50 10 84 11 100 qreg[1:0] 201e[1:0] 0 0 r/w rtc adjust. see section 1.5.3 real - time clock (rtc) for additional details. rst_subsec 2010[0] 0 0 r/w the sub - second counter is restarted when a 1 is written to this bit. rtca_adj[6:0] 2011[6:0] 40 ? r/w analog rtc adjust. see sect ion 1.5.3 real - time clock (rtc) for additional details. rtc_sec[5:0 rtc_min[5:0] rtc_hr[4:0] rtc_day[2:0] rtc_date[4:0] rtc_mo[3:0] rtc_yr[7:0] 2015 2016 2017 2018 2019 201a 201b * * * * * * * nv nv nv nv nv nv nv r/w these are the year, month, day, hour, minute and second parameters of the rtc. w riting to these registers sets the time . each write operation to one of these registers must be preceded by a write to 0x20 1f ( we ). valid values for each parameter are: sec: 00 to 59, m in : 00 to 59 , hr: 00 to 23 (00 = midnight) day : 01 to 07 (01 = sunday), date: 01 to 31, mo: 01 to 12 yr : 00 to 99 (00 and all others divisible by 4 are leap years) values in the rtc registers are undefined when the ic powers up without a battery but are maintained through mission and battery modes when a sufficient voltage is maintained at the vbat pin. * no change of value at reset. rtm_e 2002[3] 0 0 r/w real time monitor (rtm) en able. when 0 , the rtm output is low. rtm0[ 9 :0] rtm1[ 9 :0] rtm2[ 9 :0] rtm3[ 9 :0] 2060[ 9:8] 2061[7:0] 2062[9:8] 2063[7:0] 2064[9:8] 2064[7:0] 2065[9:8] 2066[7:0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 r/w the f our rtm probes. before each ce code pass, the values of these re gisters are serially output on the rtm pin. the rtm registers are ignored when rtm_e = 0.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 86 ? 2005 - 2010 teri dian semiconductor corporation v1.3 name location re set wake dir description secure sfrb2[6] 0 ? r/w when set, enables security provisions that prevent external reading of the flash mem ory (zeros will be returned if the flash is read) . sec ure should be set during the pre boot phase, i.e. while preboot is set. secure is cleared when the flash is mass - erased and when the chip is reset. the bit may only be set, attempts to write zero are ignored . sel_ian 20ac[1] 0 0 r/w when set to 1, selec ts differential mode for the current input (iap, ian). when 0, the input remains single - ended (71m6532d/f only) . sel_ib n 20ac[5 ] 0 0 r/w when set to 1, selects differentia l mode for the current input (ibp, ib n). when 0, the input remains single - ended ( 7 1m6532d/f only) . sleep 20a9[6] 0 0 w puts the 71m6531 in to sleep mode. this bit is i gnored if system power is present. the 71m6531 will wake when the autowake timer times out, when the push button is pushed, when system power returns , or when reset goes high . slot0_sel[3:0] slot1_sel[3:0] slot2_sel[3:0] slot3_sel[3:0] 2090[3:0] 2090[7:4] 2091[3:0] 2091[7:4] 0 1 2 3 0 1 2 3 r/w primary multiplexer frame analog input selection. these bits map the selected input, 0 - 3 to the multiplexer state. t he adc ou tput is always written to the memory location corresponding to the input , regardless of which multiplexer state an input is mapped to (see section 1.2 analog front end (a fe) ). slot0_altsel [3:0] slot1_altsel [3:0] slot2_altsel [3:0] slot3_altsel [3:0] 2096[3:0] 2096[7:4] 2097[3:0] 2097[7:4] a 1 2 3 a 1 b 3 r/w alternate multiplexer frame analog input selection. maps the selected input to the mul tiplexer state. the additional inputs, 10 and 11 in the alternate frame are: 10 = temp 11 = vbat sp_addr[15:8] sp_addr[7:0] 2072[7:0] 2073[7:0] 0 0 0 0 r r spi address. 16 - bit address from the bus master. sp_cmd 2071 0 0 r spi command. 8 - bit command from the bus mas ter. spe 2070[7] 0 0 r/w spi port enable. enables the spi interface on pi ns seg3 through seg5. spi_flag 20b1[4] 1 1 r/w spi interrupt flag. the flag is set by the hardware and is cleared by the firmware writing a 0. firmware using this interrupt shoul d clear the spurious interrupt indication during initialization. subsec[7:0] 2014[7:0] ? ? r the remaining count, in terms of 1/256 rtc cycles, to the next one second boundary. subsec may be read by the mpu after the one second interrupt and before reach ing the next one second boundary. setting rst_subsec will clear subsec . sum_cycles [5:0] 2001[5:0] 0 0 r/w the number of pre - summer outp uts summed in the final summing stage of the ce. tmux[4:0] 20aa[4:0] 2 ? r/w selects one of 32 signals for tmuxout. for details, see section 1.5.17 test ports (tmuxout pin) . trim[7:0] 20ff 0 0 r/w contains fuse information, depending on the value written to trimsel[3:0] .
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 87 name location re set wake dir description trimsel[3: 0] 20fd[3:0] 0 0 r/w selects the trim fuse to be read with the trim register: trimsel[3:0] trim fuse purpo se 1 trimt [7 :0] trim for the magnitude of vref version[7:0] 2006 20c8 ? ? ? ? r r the device version index. this word may be read by the firmware to determine the silicon version. version[7:0] silicon version 0001 0 1 0 1 a0 5 vref_cal 2004[7] 0 0 r/w brings vref to the vref pad. this feature is disabled when vref_dis =1 . vref_dis 2004[3] 0 0 r/w disables the internal voltage reference. wake_arm 20a9[7] 0 ? w arm the autowake timer. writing a 1 to this bit arms the autowake timer and presets it with the values presently in wake_prd and wake_res . the autowake timer is reset and disarmed whenever the ic is in mission or brownout mode. the timer must be armed at least three rtc cycles before the sleep or lcd - only mode is commanded. wake_prd 20a9[2:0] 001 ? r/w sleep time. time = wake_prd[2:0] * wake_res . default = 001. maximum value is 7. wake_res 20a9[3] 0 ? r/w resolution of wake timer: 1 = 1 minute, 0 = 2.5 seconds. wd_nrovf_ flag 20b1[0] ? 0 r/w this flag is s et approximately 1 ms before the watchdog timer overflows. it is c leared by writing a 0 or on the falling edge of wake. wd_rst sfr f8[7] 0 0 w wd timer bit. this bit must wd_ovf be accesse d with byte operations. operations p ossible for this bit are: write 0xff: resets the wdt . 2002[2] 0 0 r/w the wd overflow status bit. this bit is set when the wd timer overflows. it is powered by the nonvolatile supply and at bootup will indica te if the part is recovering from a wd overflow or a power fault. this bit should be cleared by the mpu on bootup. it is also automatically cleared when reset is high. we 201f[7:0 ] ? ? w an 8 - bit value has to be written to this address prior to accessin g the rtc registers. wrprot_bt sfr b2[5] 0 0 when set, this bit protects flash addresses from 0 to boot_size *1024 from flash page erase. wrprot_ce sfr b2[4] 0 0 when set, this bit protects flash address es from ce_lctn *1024 to the end of memory from f lash page erase.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 88 ? 2005 - 2010 teridian semiconductor corporation v1.3 4.3 ce interface description 4.3.1 ce program the ce performs the precision computations necessary to accurately measure energy. different code variations are used for equ[2:0] = 0 and equ[2:0] = 1 or 2. the computations in clude offset cancella tion, products, product smoothing, product summation, frequency detection, var calculation, sag detection, peak detection and voltage phase measurement. all data computed by the ce is dependent on the selected meter equation as given by equ[2:0] . althoug h equ[2:0] = 0 and equ[2:0] = 2 have the same element mapping, the mpu code can use the value of equ[2:0] to decide if element 2 is used for tamper detection (typically done by connecting vb to va) or as a second independent element. the ce program is supp lied by teridian as a data image that can be merged with the mpu operational code for meter applications . typically, the ce program covers most applications and does not need to be modified . other variations of ce code may be available from teridian. the description in this section applies to ce code revision ce31 a04 (for equ[2:0] = 0) . deviations for c ode revision ce31a03 ( for equ[2:0] = 1 or 2 ) are noted where applicable . 4.3.2 ce data format all ce words are 4 bytes . unless specified otherwise, they are i n 32 - bit two?s complement format ( - 1 = 0xffffffff) . calibration para meters are defined in flash memory (or external eeprom) and must be copied to ce data memory by the mpu before enabling the ce . internal variables are used in internal ce calculations . input variables allow the mpu to control the behavior of the ce code . output variables are outputs of the ce calculations . the corresponding mpu address for the most signi ficant byte is given by 0x0000 + 4 x ce_address and by 0x0003 + 4 x ce_address fo r the least significant byte. 4.3.3 constants constants used in the ce data memory tables are: ? f s = 32768 hz/13 = 2520.62 hz. ? f 0 is the fundamental frequency. ? imax is the external rms current corresponding to 250 mv pk at the inputs ia and ib . ? vmax is the ext ernal rms voltage corresponding to 250 mv pk at the va and vb inputs. ? n acc , the accumulation count for energy measurements is pre_samps[1:0] * sum_cycles[5:0] . ? the duration of the accumulation inte rval for energy measurements is pre_samps[1:0] * sum_cycles [5:0 ] /f s ? ln_8 is a gain constant of the current channel , n. its value is 8 or 1 and is controlled by in_shunt . ? x is a gain constant of the pulse generators. its value is determined by pulse_fast and pulse_slow . ? voltage lsb for sag detection = vmax * 7.8798*10 - 6 v. the system constants imax and vmax are used by the mpu to convert internal quantities (as used by the ce) to ex ternal, i.e. metering quantities . their values are determined by the off - chip scaling of the voltage and current sensors used in an actua l meter . the lsb values used in this document relate digital quantities at the ce or mpu interface to external meter input quantities . for exam ple, if a sag threshold of 80 v peak is desired at the meter input, the digital value that should be pro gramm ed into sag_thr would be 80/ sag_thr lsb , where sag_thr lsb is the lsb value in the description of sag_thr . the parameters equ[2:0] , ce_e, pre_samps[1:0] and sum_cycles[5:0] essential to the function of the ce are stored in i/o ram (see section 4.2 i/o ram description ? alphabetical order ). 4.3.4 environment before starting the ce using the ce_e bit, the mpu has to establish the proper environment for the ce by implementing the f ollowing steps (for ce31a04 code) : ? load the ce data into ram. ? establish the equation to be applied in equ[2:0] . the ce code has to match the selected equation. ? establish the accumulation period and number of samples in pre_samps[1:0] = 0 (multiplier = 42) and sum_cycles[5:0] = 0x3c (60). ? set pls_interval [7:0] to 81. ? select the values for fir_len[1:0] = 2 and mux_div[3:0] = 4.
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 89 ? select th e values f o r slot0 _sel [3:0] = 0, slot1 _sel [3:0] = 1, slot2 _sel [3:0] = 2, slot3 _sel [3:0] = 3 ? select th e values f o r slot 0 _a ltsel [3:0 ] = 0x0a, slot 1 _altsel [3:0] = 1, slot 2 _altsel [3:0] = 0x0b, slot 3 _altsel [3:0] = 3. ? set chop_e[1:0] = 00 . ? initialize any mpu interrupts, such as ce_busy, xfer_busy, or a power failure detection interrupt. when different ce codes are used, a differe nt set of environment parameters needs to be established. the exact values for these parameters are stated in the application notes and other documentation ac companying the ce codes. ce codes should only be used with environment parameters specified i n this document or in the applicable ce code description. changing environment parameters at random will lead to unpr e- dictable results. t ypically, th e re are thirteen 32768 hz cycles per adc multiplexer frame (see figure 19 ) . this means that the product of the number of cycles per frame and the number of conversions per frame must be 12 (allowing for one settling cycle). during operation, chop_e[1:0] = 00 enables the automatic chopping mode and forces an alternat e multiplexer sequence at regular intervals . this enables accurate temperature measurement. 4.3.5 ce calculations table 56 : ce equ[2:0] equations and element input mapping equ[2:0] watt & var formula (wsum/varsum) element input mapping w0sum/ var0sum w1sum/ var1sum i0sqsum i1sqsum 0 va ia (1 element, 2w 1 ) with tamper detec tion va*ia va*ib ia ib 1 va*(ia - ib)/2 (1 element, 3w 1 ) va*(ia - ib)/2 (va * ib)/2 ia - ib ib 2 va*ia + vb*ib (2 element, 4w 2 ) va*ia vb*ib ia ib 4.3.6 ce s tatus and control the cestatus register provides information about the status of voltage and input ac signal frequency, which are useful for generating early power fail warnings, e.g. to initiate necessary data storage. it contains sag warning flag s for va and vb as well as f 0 , the derived clock operating at the fundamental input frequen cy. cestatus represents the status flags for the preceding ce code pass (ce busy interrupt). sag alarms are not remembered from one code pass to the next. the ce status word is r efreshed at every ce_busy interrupt. the significance of the bits in cestatus is shown in table 57. ce address name description 0x80 cestatus see description of cestatus bits in table 57. since the ce_busy interrupt typically occurs at 2520.6 hz, it is desirable to minimize the computation required in the interrupt handler of the mpu. rather than reading the ce status word at every ce_busy interrupt and interpret the sag bits, it is recommended that the mpu activate the ypulse output to generate interrupts when a sag occurs (see the description of the ceconfig register)
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 90 ? 2005 - 2010 teridian semiconductor corporation v1.3 table 57 : cestatus (ce ram 0x80) bit definitions cestatus [bit] name descri ption 31: 29 not used these unused bits will always be zero. 28 f0 f0 is a square wave at the exact fundamental frequency for the phase selected with the freqseln bits in ceconfig . 27 reserved 26 sag_b normally zero . becomes one when vb remains below sag_thr for sag_cnt samples . will not return to zero until vb rises above sag_thr . 25 sag_a normally zero . becomes one when va remains below sag_thr for sag_cnt samples . will not return to zero until va rises above sag_thr . 24: 0 not used these unused bits will always be zero. the ce is initialized and its functions are controlled by the mpu using ceconfig . this register contains in packed form sag_cnt, freqsel, ext_pulse, i0_shunt, i1_shunt, pulse_slow and pulse_fast . the ceconfig bit definitions a re given in table 58. ce address name data description 0x20 ceconfig 0x5020 see description of the ceconfig bits in table 58. ia_shunt and/or ib_shunt can configure their respective current inputs to accept shunt resistor sensors. in this case the ce provides an additional gain of 8 to the selected current input. wrate may need to be adjusted based on the values of ia _ shunt and ib_shunt . whenever ia_shunt or ib_shunt are set to 1, in_8 (in the equat ion for kh) is assigned a value of 8. the ce pulse generator can be controlled by either the mpu (external) or ce (internal) variables. control is by the mpu if ext_pulse = 1. in this case, the mpu controls the pulse rate by placing values into apulsew , apulser , apulse2 and apulse3 . by setting ext_pulse = 0, the ce controls the pulse rate based on w0sum _ x and var0sum _ x ( equ[2:0] = 0) or wsum_x ( equ[2:0] = 2). if ext_pulse = 0 and equ[2:0] = 2, the pulse inputs are w0sum_x + w1sum_x and var0sum_x + var1s um_x. in this case, creep cannot be controlled since creep is an mpu function . if ext_pulse = 0 and equ[2:0] = 0, the pulse inputs are w0sum_x if i0sqsum_x > i1sqsum_x and w1sum_x, if i1sqsum_x > i0sqsum_x . the 71m 6531 demo code creep function halts b oth internal and external pulse generation. the ext_temp bit controls the temperature compensation mode: ? when ext_temp = 0 (internal compensation), the ce will control the gain using gain_adj (see table 60 ) based on ppmc , ppmc2 and temp_x , the difference between die temperature and the refer ence / calibration temperature temp_nom . since ppmc and ppmc2 reflect the typical behavior of the reference voltage over temperature, the internal temperature com pensation eli minates the effects of temperature - related errors of vref only. ? when ext_temp = 1 (external compensation), the mpu is allowed to control the ce gain using gain_adj , based on any algorithm implemented in mpu code. the freqsel1 and freqsel0 bits select the phase used to control the ce - internal pll. ce accuracy depends on the channel selected by the freqsel1 and freqsel0 bits receiving a clean voltage signal.
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 91 table 58 : ceconfig bit definitions ceconf g [bit] name default description [19 ] [18 ] sag_mask1 sag_mask0 0 0 sets the sag control of phase b. sets the sag control of phase a. if more than one sag mask is set, a sag interrupt will only be generated when all phases enabled for the interrupt sag . [17 ] sag_int 0 when set, enables th e sag interrupt to be output on the ypulse /dio9 pin. [16 ] ext_temp 0 when set, enables the control of gain_adj by the mpu. when 0, enables the control of gain_adj by the ce. [15:8] sag_cnt 80 (0x50) the n umber of consecutive voltage samples below sag_th r before a sag alarm is declared. the maximum value is 255. sag_thr is at address 0x2 4. [7] freqsel1 0 the combination of freqsel1 and freqsel0 s elects the phase to be used for the frequency monitor , the phase - to - phase lag calculation, the zero - crossing counter mainedge_x and the f0 bit ( cestatus[28] ) . freqsel1 / freqsel 0 = 0/0: phase a freqsel1 / freqsel 0 = 0/1: phase b [6] freqsel0 0 [5] ext_pulse 1 when zero, causes the pulse generat ors to respond to internal data ( pulse0 = wsum_x , pulse1 = varsum_x ., pulse2 = vasum_x ) . otherwise, the generators respond to values the mpu places in apulsew and apulser . [4] ? 0 unused . [3] ib_shunt 0 when 1, the current gain of channel b is increased by 8. the gain factor controlled by in_shunt is referred to as in_8 throughout this document. [2] ia_shunt 0 when 1, the current gain of channel a is increased by 8. [1] pulse_fast 0 when pulse_fast = 1, the pulse generator input is increased 16x . when pulse_slow = 1, the pulse generator input is reduced by a factor of 64. these two bits control the pulse gain factor x (see table below). default is 0 for both (x = 6). pulse_slow pulse_fast x 0 0 1.5 * 2 2 = 6 0 1 1.5 * 2 6 = 96 1 0 1.5 * 2 - 4 = 0.09375 1 1 do not use [0] pulse_slow 0 table 59 : sag threshold control ce address name default description 0x24 sag_thr 443000 the threshold for sag warnings. the default value is equivalent to 80 v rms if vmax = 600 v. the lsb value is vmax * 4.255*10 - 7 v (peak). table 60 : gain adjust control ce address name default description 0x40 g ain _ adj 16384 this register scales all voltage and current channels. the default value is equivalent unity gain (1.000) .
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 92 ? 2005 - 2010 teridian semiconductor corporation v1.3 4.3.7 ce transfer v ariables when the mpu receives the xfer_busy in terrupt, it knows that fresh data is available in the transfer variables . ce trans fer variables are modified during the ce code pass that ends with an xfer_busy interrupt. they remain constant throughout each accumulation interval. in this data sheet, t he names of ce transfer variables always end with _x . the transfer variables can be categorized as: 1. fundamental energy measurement variables 2. instantaneous (rms) values 3. other measurement parameters fundamental energy measurement variables table 61 describes each transfer variable for fundamental energy measurement. all variables are signed 32- bit integers. accumulated variables such as wsum are internally scaled so they have at least 2x margin before overflow whe n the integration time is one second. additionally, the hardware will not permit output values to fold back upon overflow. table 61 : ce transfer variables ce address name description 0x85 w sum_x for equ[2:0] = 2, this register holds t he c alculated sum of w h samples from each wattmeter element ( in_8 is the gain of 1 or 8 configured by ia_shunt or ib_shunt ). lsb = 6.6952*10 - 13 vmax imax / in_8 wh. 0x86 w0sum_x the sum of w h samples from each wattmeter element ( in_8 is the gain of 1 or 8 configured by ia_shunt or ib_shunt ). lsb = 6.6952*10 - 13 vmax imax / in_8 wh. 0x87 w1sum_x 0x8a var sum_x for equ[2:0] = 2, this register holds t he calculated sum of varh samples from each element ( in_8 is the gain of 1 or 8 configured by ia_s hunt or ib_shunt ). lsb = 6.6952*10 - 13 vmax imax / in_8 var h. 0x8b var0sum_x the sum of var h samples from each element ( in_8 is the gain 1 or 8 configured by ia_shunt or ib_shunt ). lsb = 6.6952*10 - 13 vmax imax / in_8 var h. 0x8c var1sum_x wxsum_x is the wh value accumulated for element x in the last accumulation interval and can be computed based on the specified lsb value. for example , with vmax = 600 v and imax = 208 a, the lsb for wxsum_x is 0.08356 wh. instantaneous measurement variables table 62 contains various measurement results. the frequency measurement is computed for the phase selected with freqseln bits in the ceconfig register . ixsqsum_x and vxsqsum are the squared current and voltage samples a cquired during the last accumula tion interval . they can be used to calculate rms voltages and currents. insqsum_x can be used for computing the neutral current. table 62 : ce energy measurement variables ce address name descript ion 0x82 freq_x fundamental frequency . lsb 6 32 10 587 . 0 2 ? ? s f hz 0x8f i0sqsum_x the sum of squared current samples from each element.
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 93 0x90 i1sqsum_x lsb i = 6.6952*10 - 13 imax 2 / in_8 2 a 2 h 0x93 v0sqsum_x the sum of squared vol tage samples from each e lement. lsb v = 6.6952*10 - 13 vmax 2 v 2 h 0x94 v1sqsum_x 0x45 wsum_accum these registers contain roll - over accumulators for wpulse and vpulse respectively. 0x46 vsum_accum 0x47 sum 3 _accum these registers contain roll - over accumulators for pulse outputs xp ulse and ypulse respectivel y. 0x48 sum 4 _accum 0x99 i0sqres_x these registers hold residual current measurements with double - precision accuracy. the exact current isqn is: isqn = insqsum_x + 2 32 * insqres_x 0x9a i1sqres_x the rms values can be comput ed by the mpu from the squared current and voltage samples as follows: acc s i rms n f lsb ixsqsum ix ? ? ? = 3600 other measurement parameters table 63 describes the ce measurement parameters listed below: ? mainedge_x: useful for i mplementing a real - time clock based on the input ac signal. mainedge_x is the number of half - cycles accounted for in the last accumulated interval for the ac signal. ? temp_raw : m ay be used by the mpu to monitor the chip temperature or to implement tempera ture compensation. ? gain_adj: a scaling factor for measurements based on the temperature. gain_adj can be controlled by the mpu for temperature compensation. ? vbat_sum_x : this result can be used to calculate the measured battery voltage (vbat). table 63 : useful ce measurement parameters ce address name default description 0x83 mainedge_x n/a the number of zero crossings of the voltage selected with freqseln in the pre vious ac cumulation interval . zero crossings are either direc tion and are de bounced. 0x81 temp_raw_x n/a the f iltered, un - scaled reading from the temperature sensor. 0x 9d temp_x n/a this register contains the d ifference between the die temperature and the reference/calibration temperature as established in the te mp_nom register , measured in 0.1c. 0x40 gain_adj 16384 scales all voltage and current inputs . a value of 16384 provides unity gain. this register is used by the ce or by the mpu to im ple ment temperature compensation. 0x84 vbat_sum_x n/a output of the battery measurement. this value is equivalent to twice the measured adc value. 4.3.8 pulse generation table 64 describes the ce pulse generation parameters wrate , apulsew , apulser , apulse2 and apulse3 . wrate controls the number of pulses that are generated per measured wh and varh quantities. the lower wrate is the slower the pulse rate for measured energy quantity. the metering constant kh is derived from wrate as the amount of energy measured for each pulse. that is, if kh = 1 wh/pulse, a power applied to the meter of 120 v and 30 a (3,600 w) results in one pulse per second. if the load is 240 v at 150 a (36,000 w) , ten pulses per second will be generated. the maximum pulse rate is 7.5 khz for apulsew and apulser and 1.2 khz for apulse2 and apulse3 . acc s v rms n f lsb vxsqsum vx ? ? ? = 3600
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 94 ? 2005 - 2010 teridian semiconductor corporation v1.3 the maximum time jitter is 67 s and is independent of the number of pulses measured. thus, if the pulse generator is monitored for one second, the peak jitter is 67 ppm. after 10 seconds, the peak jitter is 6.7 ppm. the average jitter is always zero. if it is attempted to drive either pulse generator faster than its maximum rate, it will simply output at its maximum rate without exhibiting any rollover characteristics. the actual pulse rate, using wsum as an exampl e, is: hz x f wsum wrate rate s 46 2 ? ? ? = , where f s = sampling frequency (2520.6 hz) and x = pulse speed factor (as defined in the ceconfig register with the pulse_fast and pulse_slow bits) . table 64 : ce pulse generation parameters ce address name default description 0x21 wrate 827 kh = vmax*imax*47.1132 / ( in_8 * wrate *n acc *x) wh/pulse . the defa ult value results in a kh of 1.0 wh/pulse when 2520 samples are taken in each accumulation interval (and vmax=600, imax = 442 [for 400 shunt] , in_8 = 1, x = 6). maximum value = 2 15 - 1. 0x41 apulsew 0 watt pulse generator input (see dio_pw bit) . the output pulse rate is: apulsew * f s * 2 - 32 * wrate * x * 2 - 14 . this input is buffered and can be loaded during a computation interval . t he change will take effect at the beginning of the next interval. 0x42 apulser 0 var pulse generator input (see dio_pv bit) . the output pulse rate is: apulser * f s *2 - 32 * wrate * x * 2 - 14 . this input is buffered and can be loaded during a computation in terval . the change will take effect at the beginning of the next interval. 0x43 apulse2 0 third pulse generator input (see dio_pv bit) . the output pulse rate is: apulse2 * f s *2 - 32 * wrate * x * 2 - 14 . this input is buffered and can be loaded during a co mputation interval . the change will take effect at the beginning of the next interval. 0x44 apulse3 0 fourth pulse generator input (see dio_pv bit). the output pulse rate is: apulse3 * f s *2 - 32 * wrate * x * 2 - 14 . this input is buffered and can be loade d during a computation interval. the change will take effect at the beginning of the next interval. 0x38 pulse width 12 register for pulse width control of xpulse and ypulse . the ma x- imum pulse width is (2* pulsewidth +1)*(1/fs). the default value will gen erate pulses of 10 ms width at fs = 2520.62 hz. 4.3.9 ce calibration parameters table 65 lists the parameters that are typically entered to effect calibration of meter accuracy. table 65 : ce cal ibration parameters ce address name default description 0x10 cal_ia 16384 these constants control the gain of their respective channels . the n ominal value for each parameter is 2 14 = 16384 . the gain of each channel is directly proportional to its gain constant . thus, if the gain of the ia channel is 1% slow, cal _ia should be scaled by 1/(1 ? 0.01) and the resulting value is 16549. 0x11 cal_va 16384 0x12 cal_ib 16384 0x13 cal_vb 16384 0x18 phadj_a 0 these two constants control the ct phase comp ensation. no com pensation occurs when phadj_x = 0. as phadj_x is increased, more compensation (lag) is introduced. range: 2 15 ? 1. if it is de sired to delay the current by the angle , the equations are:
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 95 ce address name default description 0x19 phadj_b 0 ? ? ? = tan tan x phadj 0131 . 0 1487 . 0 02229 . 0 2 _ 20 at 60hz ? ? ? = tan tan x phadj 009695 . 0 1241 . 0 0155 . 0 2 _ 20 at 50hz 0x 1f temp_nom 0 this register contains the r eference point for the temperature mea surement. at calibration temperature, the value read at temp_raw_x should be written to temp_nom . the ce will calculate the chip temperat ure temp_x relative to the reference temperature. 0x3 9 degscale 9174 the scale factor for the temperature calculation. it is not necessary to use values other than the default value. 4.3.10 other ce parameters table 66 shows the ce parameters used for suppression of noise due to scaling and truncation effects. the table also includes the parameter which indicates the ce code version. table 66 : ce parameters for noise su p pression and code version ce a d- dress name default description 0x22 kv ar 6448 this is the scale factor for the var calculation. no value other than the default value should be applied. 0x26 quant_a 0 these parameters are added to the watt calculation for element 0 and 1 to compen sate for in put noise and truncation. lsb = (vmax*imax / in_8 ) *7.4162*10 - 10 w 0x27 quant_b 0 0x2a quant_vara 0 these parameters are added to the var calculation for ele ment a and b to com pensate for in put noise and truncation. lsb = (vmax*imax / in_8 ) * 7.4162*10 - 10 w 0x2b quant_varb 0 0x2e quant_ia 0 these parameters are added to compensate for input noise and truncation in their respective channels in the squaring calculations for i 2 and v 2 . lsb = vmax 2 *7.4162*10 -10 v 2 and lsb = (imax 2 / in_8 2 )*7. 4162*10 - 10 a 2 0x2f quant_ib 0 0x35 0x63653331 text strings holding the ce version information as supplied by the ce data associated with the ce code. for example, the words 0x63653331 and 0x61303463 form the text string ?ce31a04c?. these locations are o verwritten in operation. 0x36 0x61303463 0x37 0x00000000 4.3.11 ce flow diagrams figure 41 t hrough figure 43 show the data flow through the ce in simplified form. function s not shown include delay compensation, sample interpolation, scaling and processing of meter equations.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 96 ? 2005 - 2010 teridian semiconductor corporation v1.3 figure 41 : ce data flow: multiplexer and adc figure 42 : ce data flow: scaling, gain control, in termediate variables
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 97 figure 43 : ce data flow: s quaring and summation stages
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 98 ? 2005 - 2010 teridian semiconductor corporation v1.3 5 e lectrical s pecifications 5.1 a bsolute m aximum r atings table 67 shows the absolute maximum ranges for the device . stresses beyond absolute maximum ratings may cause permanent damage to the device. these are stress ratings only and functional operation at these or any other condition s beyond those indicated under recommended operating conditions ( section 5.3 ) is not implied. exposure to absolute - maximum - rated conditions for extended periods may affect device reliability. all voltages are with respect to gnda. table 67 : absolute maximum ratings v oltage and current supplies and ground pins v3p3sys, v3p3a ? 0.5 v to 4.6 v vbat - 0.5 v to 4.6 v gndd - 0.5 v to +0.5 v analog output pins v3p3d - 10 ma to 10 ma, - 0.5 v to 4.6 v vref - 10 ma to +10 ma, - 0.5 v to v3p3a+0.5 v v2p5 - 10 ma to +10 m a, - 0.5 v to 3.0 v analog input pins ia, va, ib, vb, v1 - 10 ma to +10 ma - 0.5 v to v3p3a+0.5 v xin, xout - 10 ma to +10 ma - 0.5 v to 3.0 v all other pins configured as seg or com drivers - 1 ma to +1 ma, - 0.5 to v3p3d+0.5 configured as digital in puts - 10 ma to +10 ma, - 0.5 to 6 v configured as digital outputs - 15 ma to +15 ma, - 0.5 v to v3p3d+0.5 v all other pins ? 0.5 v to v3p3d+0.5 v temperature and esd stress operating junction temperature (peak, 100ms) 140 c operating junction temperatu re (continuous) 125 c storage temperature ? 45 c to +165 c solder temperature ? 10 second duration 250 c esd stress on all pins 4 kv
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 99 5.2 recommended external components table 68 : recommended external components name from to fu nction value unit c1 v3p3a agnd bypass capacitor for 3.3 v supply 0.1 20% ? f c2 v3p3d gndd bypass capacitor for 3.3 v output 0.1 20% ? f csys v3p3sys gndd bypass capacitor for v3p3sys 1.0 30% f c2p5 v2p5 gndd bypass capacitor for v2p5 0.1 20% f xtal xin xout 32.768 khz crystal ? electrically similar to ecs .327 - 12.5 - 17x or vishay xt26t, load capacitance 12.5 pf 32.768 khz cxs xin agnd load capac itor for crystal (depends on crystal specs and board parasitics). 33 10% pf cxl xout agnd load capacitor for crystal (depends on crystal specs and board parasitics). 15 10% pf notes: 1. agnd and gndd should be connected together. 2. v3p3sys and v3p3a should be connected together. ? for accuracy and emi rejection, c1 + c2 should be 470 f or higher. 5.3 r ecommended operating c onditions table 69 : recommended operating conditions p arameter condition min typ max unit v3p3sys, v3p3a : 3.3 v s upply voltage v3p3a and v3p3sys must be at the same voltage normal operation 3.0 3.3 3.6 v battery backup 0 3.6 v vbat no battery externally connect to v3p3sys battery backup : brn and lcd modes sleep mode 3.0 2.0 3.8 3.8 v v operating temper ature - 40 +85 oc
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 100 ? 2005 - 2010 teridian semiconductor corporation v1.3 5.4 p erformance s pecifications 5.4.1 input logic levels table 70 : i nput logic levels p arameter c ondition m in t yp m ax u nit digital high - level input voltage a , v ih 2 v digital low - level input voltage a , v il 0.8 v in put pull - up current, i il e_rxtx, e_rst, cktest other digital inputs vin=0 v, ice_e=1 10 10 - 1 0 100 100 1 a a a input pull down current, i ih ice_e reset pb other digital inputs vin = v3p3d 10 10 - 1 - 1 0 0 100 100 1 1 a a a a a in battery powered modes, digital inputs should be below 0.3 v or above 2.5 v to minimize battery current. 5.4.2 o utput logic levels table 71 : output logic levels p arameter c ondition m in t yp m ax u nit digital high - level output voltage v oh i load = 1 ma v3p3d ? 0.4 v i load = 15 ma v3p3d - 0.6 v digital low - level output voltage v ol i load = 1 ma 0 0.4 v i load = 15 ma 0.8 v opt_tx v oh ( v3p3d - opt_tx ) i source =1 ma 0.4 v opt_tx v ol i sink =20 ma 0.7 v 5.4.3 power - fault c omparator table 72 : power - f ault comparator performance specifications p arameter c ondition m in t yp m ax u nit offset voltage : v1 - vbias - 20 +15 mv hysteresis current: v1 vin = vbias ? 100 mv 0.8 1.2 a response time : v1 + 100 mv overdrive voltage at v 1 rising voltage at v1 falling 10 8 37 100 100 s s wdt disable threshold: v1 - v3p3a - 400 - 10 mv 5.4.4 battery monitor table 73 : batter y monitor performance specifications ( bme = 1 ) p arameter c ondition m in typ max unit load resis tor 27 45 63 k lsb value [ m40mhz , m26mhz ] = [00], [10], or [11] fir_len[1:0] =0 (l=138) fir_len[1:0] =1 (l=288) fir_len[1:0] =2 (l=384) ( - 10%) - 48.7 - 5.35 - 2.26 (+10%) v v v [ m40mhz , m26mhz ] = [01] fir_len[1:0] =0 (l=186) fir_len[1:0] =1 (l=384) fir_le n[1:0] =2 (l=588) ( - 10%) - 19.8 - 2.26 - 0.63 (+10%) v v v offset error -200 0 +100 mv
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 101 5.4.5 s upply c urrent table 74 : supply current performance specifications p arameter c ondition m in t yp max unit v3p3sys current (ce off) normal opera tion, v3p3a = v3p3sys = 3.3 v ckmpu = 614 khz no flash memory write rtm_e =0, eck_dis =1, adc_e =1, ice_e=0 4.2 6 .3 5 ma v3p3sys current (ce on) 8.4 9.6 ma v3p3a current 3. 3 3.8 ma vbat current - 400 +400 na v3p3sys current, write flash normal ope ration as above, except write flash at maximum rate, ce_e = 0, adc_ e = 0 9.1 12 ma vbat current vbat=3.6v brownout mode 71m6531d/f 71m6532d/f lcd mode lcd dac off lcd dac on sleep mode 52 82 11 21 0.7 250 250 40 46 1.5 a a a a a 5.4.6 v3p3d s witch table 75 : v3p3d switch performance specifications p arameter c ondition m in t yp max unit on resistance ? v3p3sys to v3p3d | i v3p3d | 1 ma 9 15 on resistance ? vbat to v3p3d | i v3p3d | 1 ma 32 5 0 5.4.7 2.5 v vo ltage r egulator table 76 : 2.5 v voltage regulator performance specifications p arameter c ondition m in t yp max unit v2p5 i load = 0 2.3 2.5 2.7 v v2p5 load regulation i load = 0 ma to 5 ma 40 mv voltage overhead v3p3 - v2p5 i load = 5 ma, r educe v3p3 until v2p5 drops 200 mv 470 mv pssr ? v2p5/ ? v3p3 reset=0, iload=0 - 2 +2 mv/v 5.4.8 l ow -p ower v oltage r egulator unless otherwise specified, v3p3sys = v3p3a = 0, pb=gnd (brownout) . table 77 : low - power voltage regulator performance specifications p arameter c ondition m in t yp max unit v2p5 i load = 0 2. 3 2.5 2.7 v v2p5 load regulation i load = 0 ma to 1 ma 30 mv vbat voltage requirement i load = 1 ma, r educe vbat until reg_lp_ok = 0 3.0 v psrr v2p5/vbat i load = 0 - 5 0 50 mv/v
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 102 ? 2005 - 2010 teridian semiconductor corporation v1.3 5.4.9 c rystal o scillator table 78 : crystal oscillator performance specifications p arameter c ondition m in t yp max unit maximum output power to crystal 4 crystal connected 1 w xin to xout capacitance 1 3 pf capacitance to gndd 1 xin xout rtca_adj[6:0] = 0 5 5 pf pf 5.4.10 lcd dac table 79 : lcd dac performance specifications p arameter c ondition m in t yp max unit vlcd voltage v 019 . 0 lcd_dac) 059 . 0 1 ( 3 p 3 v v lcd ? ? ? ? = 1 lcd_dac[2:0] 7 - 10 +10 % 5.4.11 lcd d rivers the i nformation in table 80 a pplies to all com and seg pins with lcd_dac[2:0] = 000 . table 80 : lcd driver performance specifications p arameter c ondition m in t yp max unit vlc2 voltage with respe ct to vlcd 1 - 0.1 +0 .1 v vlc1 voltage ? , ? bias ? bias ? bias, minimum output level with respect to 2*vlc2/3 with respect to vlc2/2 - 3 - 3 +2 +2 1.0 % vlc2 % vlc2 v vlc0 voltage, ? bias with respect to vlc2/3 - 4 +1 % vlc1 impedance ? i load = 100 a ( isink) 9 15 k ? i load = - 100 a ( isource) 9 15 vlc0 impedance ? i load = 100 a ( isink) 9 15 k ? i load = - 100 a ( isource) 9 15 1 vlcd is v3p3sys in mission mode and vbat in brownout and lcd modes. ? specified as percentage of vlc2, the m aximum lcd voltage. 5.4.12 optical interface table 81 : optical interface performance specifications p arameter c ondition m in t yp max unit opt_tx v oh (v3p3d - opt_tx) i source =1 ma 0.4 v opt_tx v ol i sink = 20 ma 0.7 v
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 103 5.4.13 temperature sensor table 82 shows the performance for the temperature sensor . the lsb values do not include the 8 - bit left shift at ce input. table 82 : temperature sensor performance specifications p arame ter c ondition m in t yp max unit nominal relationship: n(t) = s n *(t - t n ) + n n , t n = 25oc nominal sens i- ti v ity (s n ) 4 3 3 00109 . 0 ? ? ? ? ? ? ? ? = l s n [ m40mhz , m26mh ] = [00], [10], or [11] fir_len[1:0] =0 (l=138) fir_len[1:0] =1 (l=288) fir_len[1:0] =2 (l=384) - 106 - 964 - 2286 lsb/oc [ m40mhz , m26mhz ] = [01] fir_len[1:0] =0 (l=186) fir_len[1:0] =1 (l=384) fir_len[1:0] =2 (l=588) - 260 - 2286 - 8207 nominaloffset (n n ) 4 3 3 508 . 0 ? ? ? ? ? ? ? = l n n [ m40mhz , m26mhz ] = [00], [10], or [11] fir_len[1:0] =0 (l=13 8) fir_len[1:0] =1 (l=288) fir_len[1:0] =2 (l=384) 49447 449446 1065353 lsb [ m40mhz , m26mhz ] = [01] fir_len[1:0] =0 (l=186) fir_len[1:0] =1 (l=384) fir_len[1:0] =2 (l=588) 121 0 71 1065353 3 825 00 4 temperature error 1 ? ? ? ? ? ? ? ? = n n s n t n t err ) ) ( ( t n = 25c , t = - 40oc to +85oc - 10 10 oc n n is measured at t n during meter calibration and is stored in mpu or ce for use in temperature calcul a- tions. 5.4.14 vref table 83 shows the performance specificat i ons for vref . unless otherwise specified, vref_dis = 0 . table 83 : vref performance specifications p arameter c ondition m in t yp max unit vref output voltage, vref(22 ) ta = 22oc 1.193 1.195 1.197 v vref chop step 4 0 mv vref power supply sens itivity vref / v3p3a v3p3a = 3.0 to 3.6 v - 1.5 1.5 mv/v vref input impedance vref_dis = 1 , vref = 1.3 to 1.7 v 100 k vref output impedance cal =1, i load = 10 a, - 10 a 2.5 k vnom definition a 6 2 6 10 2 ) 22 ( 10 1 ) 22 ( ) 22 ( ) ( ? ? ? ? + ? ? + = tc t tc t vref t vnom v
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 104 ? 2005 - 2010 teridian semiconductor corporation v1.3 p arameter c ondition m in t yp max unit vnom temperature coefficien ts : tc1 tc2 3.18 (52.46 - trimt ) - 0.4 4 4 v /oc v /c 2 vref(t) deviation from vnom(t) ) 40 , 22 max( 10 ) ( ) ( ) ( 6 ? ? t t vnom t vnom t vref - 40 +40 ppm /oc vref aging 25 ppm / year a this relationship describes the nominal behavior of vref at different temperatures. 5.4.15 adc converter , v3p3a referenced table 84 shows the performance specifications for the adc converter, v3p3a referenced. for this data, fir_len[1:0] =0, vref_dis =0 and lsb values do not include the 8 - bit left shift at the ce inpu t. table 84 : adc converter performance specifications p arameter c ondition m in t yp max unit recommended input range (vin - v3p3a ) - 250 250 mv peak voltage to current crosstalk ) cos( * 10 6 vcrosstalk vin vin vcrosstalk ? vin = 200 mv peak, 65 hz, on v a . vcrosstalk = largest measurement on ia or ib - 10 10 v/v thd (first 10 harmonics) 1 : 250 mv - pk 20 mv - pk vin=65 hz, 64 kpts fft, blackman - harris window ckce = 5 mhz - 75 - 90 db db input impedance vin = 65 hz 40 90 k temperature coefficient of input i m- pedance vin = 65 hz 1.7 /c lsb size 3 3 75 . 4 25 . 1 ? ? ? ? ? ? ? ? = l v v ref lsb l = fir length [ m40mhz , m26mhz ] = [00], [10], or [11] fir_len[1:0] =0 fir_len[1:0] =1 fir_len[1:0] =2 3231 355 150 nv/ lsb [ m40mhz , m26mhz ] = [01] fir_len[1:0] =0 fir_len[1:0] =1 fir_len[1:0] =2 1319 150 42 nv/ lsb digital full scale 3 3 ? ? ? ? ? ? l l = fir length [ m40mhz , m26mhz ] = [00], [10], or [11] fir_len[1:0] =0 fir_len[1:0] =1 fir_len[1:0] =2 97336 884736 2097152 lsb [ m40mhz , m26mhz ] = [01] fir_len[1:0] =0 fir_len[1:0] =1 fir_len[1:0] =2 238328 2097152 7529536 lsb a dc gain error versus %power supply variation 3 . 3 / 3 3 100 / 357 10 6 a p v v nv nout in pk ? ? vin=200 mv pk, 65 hz v3p3a=3.0 v, 3.6 v 50 ppm/% input offset (vin - v3p3a ) - 10 10 mv
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 105 5.5 t iming s pecifications 5.5.1 flash memory table 85 : flash memor y timing spec ifications p arameter c ondition m in t yp max unit flash read pulse width v3p3a = v3p3sys = 0 (brownout mode) 30 100 ns flash write cycles - 40c to +85c 20,000 cycles flash data retention 25c 100 years flash data retention 85c 10 years flash by te write operations between page or mass erase operations 2 cycles write time per byte 42 s page erase (1024 bytes) 20 ms mass erase 200 ms 5.5.2 eeprom i nterface table 86 : eeprom interface timing p arameter c ondition m in t yp max unit write clock frequency (i 2 c) ckmpu = 4.9 mhz, using interrupts 78 khz ckmpu = 4.9 mhz, bit - banging dio4/5 150 khz write clock frequency (3 - wire) ckmpu=4.9 mhz 500 khz 5.5.3 r eset table 87 : reset timing p aramete r c ondition m in t yp max unit reset pulse width 5 s reset pulse fall time 1 s 5.5.4 rtc p arameter c ondition m in t yp max unit range for date 2000 2255 year
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 106 ? 2005 - 2010 teridian semiconductor corporation v1.3 5.5.5 spi slave p ort ( mission m ode) table 88 : spi slave port (mission mo de) timing p arameter c ondition m in t yp max unit t spicyc pclk cycle time 1 s t spilead enable lead time 15 ns t spilag enable lag time 0 ns t spiw pclk pulse width : high low 40 40 ns ns t spisck pcsz to first pclk fall ignore if pclk is low when pcsz falls. 2 ns t spidis disable time 0 ns t spiev pclk to data out 15 ns t spisu data input setup time 10 ns t spih data input hold time 5 ns msb out lsb out msb in lsb in t spicyc t spilead t spilag t spisck t spih t spiw t spiev t spiw t spidis pcsz pclk psdi psdo figure 44 : spi slave port ( mission mo de ) timing electrical specification f ootnotes 1. this spec will be guaranteed and verified in production samples, but will not be measured in production. 2. this spec will be guaranteed and verified in production samples, but will be measured in production only at dc. 3. this spec will be measured in production at the limits of the specified operating temperature. 4. this spec defines a nominal relationship rather than a measured parameter . correct circuit operation will be verified with other specs that use this nom inal relationship as a reference.
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 107 5.6 t ypical performance d ata 5.6.1 accuracy over current figure 45 shows accuracy over current for various load angles at room temperature. figure 45 : wh accuracy , 0.1 a to 200 a at 240 v/50 hz and room temperature 5.6.2 accuracy over temperature with digital temperature compensation enabled , the temperature characteristics of the reference voltage (vref) are compensated to within 40 ppm/c (see section 3.4 for details). - 1 - 0.75 - 0.5 - 0.25 0 0.25 0.5 0.75 1 0.1 1 10 100 1000 % error i (a rms) 6531 wh, all phases, 50 hz, 240 v 0 degree 60 degree 300 degree 180 degree
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 108 ? 2005 - 2010 teridian semiconductor corporation v1.3 5.7 71m6531d/f package 5.7.1 p ackage outline figure 46 : qfn - 68 package outline, top and side view figure 47 : qfn - 68 package outline, bottom view * pin length is nominally 0.4 mm (min = 0.3 mm, max = 0.4 mm). ** exposed pad is internally connected to gndd. *** pin 1 is marked on bottom with notch or chamfered corner in the exposed pad next to pin 1. side view top view pin #1 dot by marking 68 2 1 8.000 0.050 8.000 0. 050 0.000 0. 050 0.203 ref 0.850 0.050 pin #1 id r0.20, or chamfer 0.500 x 45 bottom view 68 1 2 6.300 0.100 exp. pad 6.300 0.100 exp. pad 6.400 ref. 0.400 0.050 0.400 bsc 0.200 0.050
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 109 5.7.2 71m6531d/f pinout (qfn -68) figure 48 : pinout for qfn - 68 package 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 31 32 26 27 28 29 30 18 19 20 21 22 24 25 35 36 37 38 39 40 41 42 43 44 45 46 47 48 64 63 62 61 67 52 53 54 55 56 57 58 59 60 65 66 seg9/e_rxtx gndd tmuxout seg37/dio17 tx seg3/pclk v3p3d seg19/cktest seg4/psdo seg5/pcsz dio2/opt_tx v3p3sys com1 com2 com3 com0 seg14 seg13 seg12 seg7/mux_sync seg8 seg6/psdi seg49/dio29 seg35/dio15 seg34/dio14 seg2 seg1 seg15 seg0 seg65/dio45 seg33/dio13 seg63/dio43 seg16 seg27/dio7/rpulse seg26/dio6/wpulse seg25/dio5/sdata seg29/dio9/ypulse rx seg31/dio11 reset v2p5 vbat seg24/dio4/sdck seg28/dio8/xpulse ice_e seg18 seg17 seg30/dio10 seg11/e_rst seg32/dio12 va pb xout test xin dio1/opt_rx v1 vref ia ib v3p3a gnda vb gndd 17 seg66/dio46 23 seg64/dio44 33 34 49 50 seg48/dio28 51 68 seg10/e_tclk teridian 71m6531d-im 71m6531f-im
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 110 ? 2005 - 2010 teridian semiconductor corporation v1.3 5.7.3 recommended pcb land pattern for the qfn - 68 package figure 49 : pcb land pattern for qfn 68 package table 89 : recommended pcb land pattern dimensions symbol description typical dimension e le ad pitch 0.4mm x pad width 0.23mm y pad length, see note 3 0.8mm d see note 1 6.3mm a 6.63mm g 7.2mm notes: 1. do not place unmasked vias in the region denoted by dimension d . 2. soldering of bottom internal pad is not required for proper operation. 3. the y dimension has been elongated to allow for hand soldering and reworking . production assembly may allow this dimensio n to be reduced as long as the g dimension is maintained.
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 111 5.8 71m6532d/f package 5.8.1 71m6532d/f pinout (lqfp -100) figure 50 : pcb land pattern for lqfp - 100 package 1 teridian 71m6532d 71m6532f 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 91 92 93 94 95 96 97 98 99 100 26 27 28 29 30 51 52 53 54 55 56 57 58 59 60 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 seg38/dio18/mtx seg9/e_rxtx gndd tmuxout seg37/dio17 tx seg3/pclk v3p3d seg19/cktest seg4/psdo seg5/pcsz dio2/opt_tx v3p3sys dio3 com1 com2 com3 com0 dio57 dio58 dio56 gndd seg14 seg13 seg12 seg7/mux_sync seg8 seg50/dio30 seg6/psdi seg36/dio16 seg49/dio29 seg2/test2 seg1/test1 seg15 seg0/test0 seg65/dio45 seg44/dio24 seg45/dio25 seg47/dio27 seg46/dio26 seg33/dio13 seg63/dio43 seg64/dio44 seg16 seg27/dio7/rpulse seg39/dio19 seg26/dio6/wpulse seg25/dio5/sdata seg29/dio9/ypulse rx seg31/dio11 gndd reset v2p5 vbat seg24/dio4/sdck seg23 seg22 seg28/dio8/xpulse seg41/dio21 seg40/dio20 ice_e seg18 seg17 seg30/dio10 seg20 seg21 seg43/dio23 vb vx v3p3a gnda va pb nc xout test xin dio1/opt_rx v1 vref iap ibn gndd seg11/e_rst seg10/e_tclk seg61/dio41 ian ibp seg35/dio15 seg34/dio14 seg67/dio47 seg68/dio48 seg69/dio49 seg70/dio50 seg71/dio51 seg42/dio22/mrx seg60/dio40 seg62/dio42 seg32/dio12
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 112 ? 2005 - 2010 teridian semiconductor corporation v1.3 5.8.2 lqfp -100 mechanical drawing figure 51 : lqfp - 100 package, mechanical drawing (dimensions are in mm.) 1 15.7(0.618) 16.3(0.641) 15.7(0.618) 16.3(0.641) top view max. 1.600 0.50 typ. 14.000 +/- 0.200 0.225 +/- 0.045 0.60 typ> 1.50 +/- 0.10 0.10 +/- 0.10 side view
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 113 5.9 pin d escriptions pin types: p = power, o = output, i = input, i/o = input/ output the circuit number denotes the equivalent circuit, as specified under section 5.9.4 i/o equivalent circuits . 5.9.1 power and ground pins table 90 : power and ground pins name type circuit description gnda p ? analog ground: this pin should be connected directly to the ground plane. gndd p ? digital ground: this pin should be connected directly to the ground plane. v3p3a p ? analog power supp ly: a 3.3 v power supply should be connected to this pin, must be the same voltage as v3p3sys. v3p3sys p ? system 3.3 v supply. this pin should be connected to a 3.3 v power supply. v3p3d o 13 auxiliary voltage output of the chip, controlled by the in ternal 3.3 v selection switch . in mission mode, this pin is internally connected to v3p3sys . in brownout mode, it is internally connected to vbat . this pin is floating in lcd and sleep mode. a bypass capacitor to ground should not exceed 0.1 f. vbat p 12 battery backup and oscillator power supply . a battery or super - capacitor is to be connected between vbat and gndd . if no battery is used, connect vbat to v3p3sys. v2p5 o 10 output of the internal 2.5 v regulator . a 0.1 f capacitor to gnda should be connected to this pin. 5.9.2 analog pins table 91 : analog pins name type circuit description ia, ib iap/ian, ibp/ibn 1) i 6 line current sense inputs: these pins are voltage inputs to the internal a/d converter . typically, they are connected to the outputs of current sensors . unused pins must be tied to v3p3a . va, vb , vx 1) i 6 line voltage sense inputs: these pins are voltage inputs to the internal a/d converter . typically, they are connected to the outputs of resistor dividers . unused pins must be tied to v3p3a. the vx pin is not supported by standard ce code. v1 i 7 comparator input: this pin is a voltage input to the internal comparator . the voltage applied to the pin is compared to the internal bias voltage (1.6 v) . if t he input voltage is above vbias, the comparator output will be high (1) . if the comparator output is low, a voltage fault will occur . a s eries resistor should be connected from v1 to the resistor divider to pro vide hysteresis . vref o 9 voltage reference for the adc . normally disabled and left unconnected. if en abled, a 0.1 f capacitor to v3p3 a should be connected to this pin. xin xout i 8 crystal inputs: a 32 khz crystal should be connected across these pins . typically, a 33 pf capacitor is also co nnected from xin to gnda and a 15 pf capacitor is connected from xout to gnda . it is important to mi nimize the capacitance between these pins . see the crystal manufacturer datasheet for details. if an external clock is used, a 150 mv (p - p) clock signal should be applied to xin, and xout should be left unconnected. 1) differential pin pairs iap/ian and ibp/ibn, as well as single - ended vx pin used on 71m6532d/f only.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 114 ? 2005 - 2010 teridian semiconductor corporation v1.3 5.9.3 digital pins table 92 : digital pins name type circuit descripti on com3,com2, com1, com0 o 5 lcd common outputs: these 4 pins provide the select signals for the lcd display. seg0?seg2, seg7, seg8 seg12?seg18 o 5 dedicated lcd segment output pins. seg 2 0?seg2 3 o 5 dedicated lcd segment output pin s (71m6532d/f only). seg24/dio4? seg35/dio15 , seg37/dio17 , seg48/dio28, seg49/dio29 , seg63/dio43? seg66/dio46 i/o 3, 4, 5 multi - use pins, c onfigurable as either lcd seg driver or dio. (dio4 = sck, dio5 = sda when configured as eeprom interface; wpulse = dio6, varpulse = di o7 when configured as pulse output s). unused pins must be configured as outputs or terminated to v3p3/gndd. 1) seg3/pclk seg4/psdo seg5/pcsz seg6/psdi i/o 3, 4, 5 multi - use pins, configurable as either lcd seg driver or spi port. e_rxtx/seg9 i/o 1, 4, 5 multi - use pins, configurable as either emulator port pins (when ice_e pulled high) or lcd seg drivers (when ice_e tied to gnd). e_rst/seg11 i/o 1, 4, 5 e_tclk/seg10 o 4, 5 ice_e i 2 ice enable. when zero, e_rst, e_tclk and e_rxtx become seg32, seg33 and seg38 respectively. for production units, this pin should be pulled to gnd to disable the emulator port. cktest/seg19 , muxsync/seg7 o 4, 5 multi - use pin s , configurable as either multiplexer/clock output or lcd segment driver using the i/o ram register s ckout_e or mux_sync_e. tmuxout o 4 digital output test multiplexer. controlled by t mux[3:0]. opt_rx/dio1 i/o 3, 4, 7 multi - use pin, configurable as optical receive input or general dio. when configured as opt_rx, this pin receives a signal from an ex ternal photo - detector used in an ir serial interface. if this pin is unused it must be configured as an out put or terminated to v3p3d or gndd. opt_tx/dio2 i/o 3, 4 multi - u se pin, configurable as either optical led transmit o utput, wpulse, rpulse, or gen eral dio. when configured as opt_tx, this pin is capable of directly driving an led for transmitting data in an ir serial interface. reset i 2 chip reset: this input pin is used to reset the chip into a known state. for normal operation, this pin is pul led low. to reset the chip, this pin should be pulled high. this pin has an internal 30 a (nominal) current source pull - down. no external reset circuitry is necessary. rx i 3 uart input. if this pin is unused it must be configured as an out put or terminated to v3p3d or gndd. tx o 4 uar t output. test i 7 enables production test. this pin must be grounded in normal operation. pb i 3 push button input. this pin must be at gndd when not active. a rising edge sets the ie_pb flag. it also causes the part to wake up if it is in sleep or lcd mode. pb does not have an internal pull - up or pull - down. 1) n ot all pins available on the 71m6531 d/f or 71m6532d/f.
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 115 5.9.4 i/o equivalent circuits figure 52 : i/o equivalent circuits oscillator equivalent circuit type 8: oscillator i/o digital input equivalent circuit type 1: standard digital input or pin configured as dio input with internal pull-up gndd 110k v3p3d cmos input v3p3d digital input pin digital input type 2: pin configured as dio input with internal pull-down gndd 110k gndd cmos input v3p3d digital input pin digital input type 3: standard digital input or pin configured as dio input gndd cmos input v3p3d digital input pin cmos output gndd v3p3d gndd v3p3d digital output equivalent circuit type 4: standard digital output or pin configured as dio output digital output pin lcd output equivalent circuit type 5: lcd seg or pin configured as lcd seg lcd driver gndd lcd seg output pin to mux gnda v3p3a analog input equivalent circuit type 6 : adc input analog input pin comparator input equivalent circuit type 7: comparator input gnda v3p3a to comparator comparator input pin to oscillator gndd oscillator pin vref equivalent circuit type 9: vref from internal reference gnda v3p3a vref pin v2p5 equivalent circuit type 10: v2p5 from internal reference gndd v3p3d v2p5 pin vlcd equivalent circuit type 11: vlcd power gndd lcd drivers vlcd pin vbat equivalent circuit type 12: vbat power gndd power down circuits vbat pin v3p3d equivalent circuit type 13: v3p3d from v3p3sys v3p3d pin from vbat 10 40
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 116 ? 2005 - 2010 teridian semiconductor corporation v1.3 6 o rdering i nformation part p art description (p ackage) flash size pack aging order number package mar k- ing 71m6531d 68- pin qfn, lead free 128 kb bulk 71m6531d - im/f 71m6531d - im 71m6531d 128 kb tape and reel 71m6531d - imr/f 71m6531d - im 71m6531f 256 kb bulk 71m6531f - im/f 71m6531f - im 71m6531f 256 kb t ape and reel 71m6531f - imr/f 71m6531f - im 71m6532d 100 - pin lqfp, lead free 128 kb bulk 71m6532d - igt/f 71m6532d - igt 71m6532d 128 kb tape and reel 71m6532d - igtr /f 71m6532d - igt 71m6532f 256 kb bulk 71m6532f - igt/f 71m6532f - igt 71m6532f 256 kb tape and reel 71m6532f - igtr /f 71m6532f - igt 7 related information the following documents applicable to the 71m6531 d/f and 71m6532d/f are available from teridian semiconductor corporation: ? 71m653 x software user?s guide (sug _653x ) ? demo board user?s guide (dbum_65 31) ? application note on m igration from the 6521 to the 6531 (an_6531_001) 8 contact information for more information about teridian semiconductor products or to check the availability of the 71m6531d/f or 71m6532d/f , contact us at: 6440 oak canyon road suit e 100 irvine, ca 92618 - 5201 telephone: (714) 508 - 8800 fax: (714) 508 - 8878 email: meter.support@teridian.com f or a complete list of worldwide sales offices, go to http://w ww.teridian.com .
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 117 appendix a: acronyms afe analog front end amr automatic meter reading ansi american national standards institute ce compute engine dio digital i /o dsp digital signal processor fir finite impulse response i 2 c inter - ic bus ice in - circuit emulator iec international electrotechnical commission mpu microprocessor unit (cpu) pll phase - locked loop r ms root mean square sfr special function register soc system on chip spi serial peripheral interface tou time of use uart universal asynchronous re ceiver/transmitter
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 118 ? 2005 - 2010 teridian semiconductor corporation v1.3 appendix b : revision history revision date description 1.3 june 9 , 2010 1) throughout document: added bit ranges to all register fields where missing (e.g. mpu_div[2:0]). 2) figure 1 , figure 2 : corrected name for psdi and psdo signals . 3) 1.4 80515 mpu core ? added sfr register addresses where needed. ? (page 19 ) table 6 : change approximate frequencies to exact frequencies. ? (page 19) changed providing library to providing demonstration source code. ? (page 20) added note about mux_div =0 disables adc output. ? (pa ge 21 ) see restrictions on intbits register. ? (page 22 ) added p1 - p3 to table 10. ? (page 23) updated data pointer description. ? (page 24 ) table 14 : updated description for fwcol0 , fwcol1 . ? (page 26 ) 1.4.6 uarts : clarified sobu f , s1buf as tx and rx buffers. ? (page 27 ) added caution on proper way to clear flag bits. ? (page 30 ) 1.4.9 inter rupts : clarified external vs internal interrupts. ? (page 31 ) table 25 : added interrupt sources for ext. interrupts 2- 6. 4) 1.5.2 internal clocks ? (page 36 ) table 37 : changed frequencies to exact frequencies. ? (page 38) added caution concerning frequency relationship to specific ce code . 5) 1.5.3 real - time clock (rtc) : (page 39) added description for obse rving rtc timing on tmuxout pin, corrected values for rtca_adj , and achievable frequency step. 6) 1.5.9 digital io ? common characteristics for 71m6531d/f and 71m6532d/f (pa ge 45) : ? a dded caution about not sourcing current in or out of dio pins. ? updated figure 10 : connecting an external load to dio pins . 7) 1.5.13 battery monitor (page 46 ): corrected ram address for adc data. 8) 1.5.15 spi slave port (page 49) : c larified description of i/o ram access via the spi interface. added table 50. 9) 2.3 battery modes (page 56 , 57 ): added details on software pr e- cautions for switching between modes and factory programming of the first 6 flash addresses. 10) 3.1 connection of sensors (pag e 63 ): added note concerning an alog input pins requiring sensors with low source impedance. 11) 3.15 mpu firmware (page 70 ): modified to indicate demonstration source code provided. 12) 3.16 crystal oscillator (page 70 ): updated caution concerning rejecti ng electromagnetic interference. 13) table 54 : i/o ram map in functional order (page 72) : updated unused and nvram locations. 14) 4.3.4 environment : added comment concerning importance of parameter dependence on ce code environment. 15) 4.3.6 ce status and control (page 89 ): ? updated description of f0 in table 57. ? updated descriptions in table 58 (page 91). 16) 4 .3.7 ce transfer variables : updated description of vbat_sum_x in table 63 (page 93 ) . 17) corrected values for ext_pulse in description of interna l pulse
fds 6531/6532 005 data sheet 71m6531d/f - 71 m6532d /f v1.3 ? 2005 - 2010 teridian semiconductor corporation 119 generation (page 89 ). 18) updated pin - out for qfn - 68 package ( figure 48 ). 19) added explanation for i n sqres _x. 20) added explanation of delay compensation in ce ( 1.3.5 ). 21) added explanation on temperature coefficients for verf in appl i- cation section ( 3.4.1 ). 22) corrected figure 30 (right side). 1.2 october 21, 2009 updated number range for rtc_adj to 0 ? 0x7f and tolerance for ex - posed pad in figure 46 to 0.1 mm. corrected bit range for ce_lctn to [7:0] and functional description for tmod[7] and tmod[3] in table 22. added maximum value for wrate and text stating that registers rtc_sec to rtc_yr do not change at reset. added v lsb entry for sag detection in ce interface description, text regarding hysteresis at section 3.10, note that vx pin is not supported by standard ce code, and description of stop and idle bi ts in pcon register. changed value for wh accuracy percentage on title page (value stated for room temperature). 1.1 july 27, 2009 updated mechanical drawing for qfn - 68 package. replaced figure 19 with single - phase example. corrected lqfp - 100 package draw ing (figure 50). applied minor corrections and enhancements to diagrams. 1.0 february 27, 2009 initial release. changes with respect to pds v1.3: 1) corrected timer/counter 0/1 label in table 22. 2) corrected entries for dio29 and dio43 in table 39. 3) updated u nused/reserved bits in i/o ram tables, added descri p- tion for we register. 4) documented blink capability for both seg18 and seg19. 5) changed package for 71m6532d/f to lqfp - 100, updated all pin tables and i/o ram tables accordingly. 6) replaced graph showing system performance specification over temperature with specification on accuracy of vref compens a- tion. 7) added explanation for hysteresis at the v1 pin in applications section. 8) added note on recommended bypass capacitors c1 and c2 in electrical specification. 9) remo ved access to i/o ram from spi port description. 10) updated numerous parameters in electrical specification (te m- perature sensor, supply current for mission and battery modes). 11) corrected number of pre - boot cycles in flash memory section. 12) updated entries in i/o ram table under ?wake? column.
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 120 ? 2005 - 2010 teridian semiconductor corporation v1.3 ? 2008 - 2010 teridian semiconductor corporation. all rights reserved . teridian semiconductor corporation i s a registered trademark of teridian semiconductor corporation. single con verter technology is a registered trademark of teridian semiconductor corporation. simplifying system integration is a trademark of teridian semiconductor corporation. intel is a r egistered t rademark of intel corporation. all other trademarks are the property of their respective owners. teridian semiconductor corporation makes no warranty for the use of its products, other than expressly contained in the company?s warranty detailed in the teridian semiconductor corporation standard terms and conditions. the company assumes no responsibility for any errors which may appear in this doc u- ment, reserves the right to change devices or specifications detailed herein at any time without not ice and does not make any commitment to update the information contained herein. accordingly, the reader is cautioned to verify that this document is current by comparing it to the latest version on http://www.teridian.com or by checking with your sales r epresentative.


▲Up To Search▲   

 
Price & Availability of 71M6531D10

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X